lua-users home
lua-l archive

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


Well, for whom it may concern: the luasec will perform multiplexing (performing select()/poll() inside of socket_waitfd()) on socket in case of partial SSL reads/writes, so having O_NONBLOCK sockets and performing classic poll-ing by external code wouldn't help - it can still block until timeout. The code is obvious. Sorry for buzzing...


On Tue, Mar 5, 2013 at 1:31 AM, Bezobiuk Volodymyr <dedoogun@gmail.com> wrote:
Hi

Does anybody got the experience working with luasec ssl.wrap() connection object with non-blocking sockets? I mean that i supposed to fake the luasocket one with
  { getfd=function()...end, setfd=function()...end }
table so luasec would think i passed the right luasocket object, but file descriptors will be pulled from nixio sockets, nonblocking one needed. Maybe someone tried that already: can i assume that behaviour of nonblocking socket will be quite the same as if the timeout for the connection object is set - returning 'wantread' and 'wantwrite' if the operation on the socket was not complete in the terms os SSL/TLS protocols? And so code pattern should be the same? Will read the luasec source if nobody knows yet...

Sincerely,
  Volodymyr Bezobiuk