Comparison

net/server_select.lua @ 5950:bd1d1c29a7e7

Merge 0.9->0.10
author Matthew Wild <mwild1@gmail.com>
date Mon, 16 Dec 2013 23:32:11 +0000
parent 5846:b8c7656481ac
parent 5949:a9abbdeddbf3
child 5956:59997f3f5502
child 6054:7a5ddbaf758d
comparison
equal deleted inserted replaced
5945:51ead0aa3a02 5950:bd1d1c29a7e7
918 _sendlistlen = addsocket(_sendlist, socket, _sendlistlen) 918 _sendlistlen = addsocket(_sendlist, socket, _sendlistlen)
919 if listeners.onconnect then 919 if listeners.onconnect then
920 -- When socket is writeable, call onconnect 920 -- When socket is writeable, call onconnect
921 local _sendbuffer = handler.sendbuffer; 921 local _sendbuffer = handler.sendbuffer;
922 handler.sendbuffer = function () 922 handler.sendbuffer = function ()
923 _sendlistlen = removesocket( _sendlist, socket, _sendlistlen );
924 handler.sendbuffer = _sendbuffer; 923 handler.sendbuffer = _sendbuffer;
925 listeners.onconnect(handler); 924 listeners.onconnect(handler);
926 -- If there was data with the incoming packet, handle it now. 925 return _sendbuffer(); -- Send any queued outgoing data
927 if #handler:bufferqueue() > 0 then
928 return _sendbuffer();
929 end
930 end 926 end
931 end 927 end
932 end 928 end
933 return handler, socket 929 return handler, socket
934 end 930 end