lua-users home
lua-l archive

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


On Fri, Mar 16, 2012 at 2:28 AM, Egil Hjelmeland
<privat@egil-hjelmeland.no> wrote:
> That is one of the things I don't like about LuaSockets: AFAIK there is no
> way from Lua to make the socket nonblocking. By nonblocking I mean in C

Isn't that what:

sock:settimeout(0)

does?

> The second thing is that all error codes should be returned so they can be
> dealt with.

strerror(errno) is returned, but its true that these strings are
human-readable, but difficult to deal
with programmatically.

luasocket would be better to follow the lua io libraries convention of returning

   nil, emsg, errno

So that the specific reason for an error can be recovered.
Unfortunately, its a wide-reaching change, and the problem hasn't been
serious enough to make me want to attempt it. Maybe you have the time?

Cheers,
Sam