Comparison

net/server_select.lua @ 2970:9b8e139eff5f

net.server_select: Support for listener.onconnect
author Matthew Wild <mwild1@gmail.com>
date Sun, 11 Apr 2010 01:11:42 +0100
parent 2968:fdd049a4e551
child 2998:36c169ed1576
child 3000:43a4cb707fe4
comparison
equal deleted inserted replaced
2968:fdd049a4e551 2970:9b8e139eff5f
609 receive = socket.receive 609 receive = socket.receive
610 shutdown = ( ssl and id ) or socket.shutdown 610 shutdown = ( ssl and id ) or socket.shutdown
611 611
612 _socketlist[ socket ] = handler 612 _socketlist[ socket ] = handler
613 _readlistlen = addsocket(_readlist, socket, _readlistlen) 613 _readlistlen = addsocket(_readlist, socket, _readlistlen)
614 614 if listeners.onconnect then
615 _sendlistlen = addsocket(_sendlist, socket, _sendlistlen)
616 handler.sendbuffer = function ()
617 listeners.onconnect(handler);
618 handler.sendbuffer = _sendbuffer;
619 if bufferqueuelen > 0 then
620 return _senddbuffer();
621 end
622 end
623 end
615 return handler, socket 624 return handler, socket
616 end 625 end
617 626
618 id = function( ) 627 id = function( )
619 end 628 end