lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi Valerio,

lsocket is not intended as a replacement for luasocket. It is a lot simpler (in
both senses of the meaning) than luasocket, and not as complete. If you want too
do heavy duty socket programming, you're probably better off with luasocket. I
had this in the first announcement of lsocket:

"With lsocket, I restrict myself to what I percieve as the most common use cases
of socket programming, and attempting to make those things easy. Also,
everything
(apart from select, and, if you wish to count them, dns resolutions) is
non-blocking."

Obviously, connect() is also blocking... but you get the idea: make simple
things reasonably easy, make complex things use luasocket :) Which is not to say
that lsocket can only do simple things, I have written a basic httpd with it,
that works quite well.

Gunnar

Valerio Schiavoni <valerio.schiavoni@gmail.com> hat am 2. April 2013 um 10:14
geschrieben:
> Hello Gunnar,
> a couple of questions about lsocket:
>
> - how does it differ from luasocket ?
> - how does it perform against it, in terms of memory usage for example  ?
> - is it compatible with luasocket (ie. is it a drop-in replacement) ?
> - why one project should be ported to lsocket ? do you see a long-term
> advantage ?
>
> Thanks for your time.
> Valerio
>
> On Tue, Apr 2, 2013 at 9:03 AM, "Gunnar Zötl" <gz@tset.de> wrote:
> >
> > Hi,
> >
> > this message is to announce the availability of version 1.0.1, lsocket,
> > another
> > take of a socket programming library for lua.
> >
> > It is not intended to be a complete socket api, but easy to use and good
> > enough
> > for most tasks. Both IPv4 and IPv6 are supported, as are tcp and udp, and
> > also
> > IPv4 broadcasts and IPv6 multicasts.
> >
> > Changes since 1.0:
> > - enhance check of whether a nslookup is needed, should now cover all cases
> > - modified select() to ignore closed sockets, also calling select() without
> > open
> > sockets and without timeout is now an error (instead of blocking forever).
> > - added constant _VERSION, which contains the full version number for
> > lsocket.
> > - fixed an issue that would keep the Mac's from compiling this
> > - some cleanup in the 5.1/5.2 compatibility department as suggested by lhf
> >
> > You can get lsocket from http://www.tset.de/lsocket
> >
> > or via luarocks install lsocket.
> >
> > Rgds,
> >
> > Gunnar
> >