[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Raw socket patches for LuaSocket
- From: Justin Cormack <justin@...>
- Date: Tue, 4 Jun 2013 19:09:57 +0100
On Tue, Jun 4, 2013 at 3:16 PM, Sean Conner <sean@conman.org> wrote:
> 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 [1] 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.
ljsyscall https://github.com/justincormack/ljsyscall supports raw
sockets but currently only works on LuaJIT (Lua port will happen but
not in the very short term). There are some examples in the tests.
Justin