On Thu, Sep 16, 2010 at 6:31 AM, steve donovan
<steve.j.dono...@gmail.com> wrote:
> Hi all,
>
> The background is that I want to use Lanes with Luasocket, and found
> that I needed one little patch to do the job. The issue with Lanes is
> that one cannot pass userdata to a lane, because it has to copy all
> parameters across to the new Lua state, and does not know the intended
> copy semantics of any piece of userdata.  However, s:getfd() _and_
> s:getfd() exist for sockets, although not documented, since it breaks
> encapsulation and no doubt leads to trouble somewhere.  We can pass
> handles (as numbers that can pass as Lua numbers) to a Lane, and the
> patch adds socket.client(fd) which is given a previously prepared
> socket handle and makes us a client socket.
>...
One thing you could do that would work safely is to make a Luasocket
socket instances a 'deep userdata' object.
These can be passed between lanes/threads without
unwrapping/rewrapping sockets.


-- 
Thomas Harning Jr.

_______________________________________________
Kepler-Project mailing list
Kepler-Project@lists.luaforge.net
http://lists.luaforge.net/cgi-bin/mailman/listinfo/kepler-project
http://www.keplerproject.org/

Reply via email to