[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Raw socket patches for LuaSocket
- From: Sean Conner <sean@...>
- Date: Tue, 4 Jun 2013 10:16:28 -0400
It was thus said that the Great Sean Conner once stated:
> It was thus said that the Great greatwolf once stated:
> > Diego Nehab-3 wrote
> > > I don't remember seeing a full patch, but I blieve it would
> > > be easy to create a module in the flavour of the unix domain
> > > socket support that ships with LuaSocket as a sample.
> > It looks like raw socket support has been requested a few times around the
> > internet already. But checking the repo here
> > <https://github.com/diegonehab/luasocket/tree/unstable> shows no
> > indication that this feature has ever been incorporated.
> > Is there any hope of adding this in soon so we don't have to hack together
> > our own ad-hoc solution to this?
> Hmmm ... I know my own socket module  supports IPv4, IPv6 and Unix
> sockets. I don't have code for HTTP, FTP or what have you, but I wanted a
> decent low level implementation of sockets under Lua. The :read() and
> :write() functions on sockets don't work the same as they do for files
> though (they should have been named :recvfrom() and :sendto()).
I should also mention that I also support raw sockets as well. If you
specify a socket type of anything other than 'tcp' or 'udp', you get a raw
socket. You do need to be root to create such a socket though.
-spc (The downside---I don't program under Windows, so the code only
works on Unix)