aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/server_select.lua11
1 files changed, 10 insertions, 1 deletions
diff --git a/net/server_select.lua b/net/server_select.lua
index ebf5c427..48262ccc 100644
--- a/net/server_select.lua
+++ b/net/server_select.lua
@@ -611,7 +611,16 @@ wrapconnection = function( server, listeners, socket, ip, serverport, clientport
_socketlist[ socket ] = handler
_readlistlen = addsocket(_readlist, socket, _readlistlen)
-
+ if listeners.onconnect then
+ _sendlistlen = addsocket(_sendlist, socket, _sendlistlen)
+ handler.sendbuffer = function ()
+ listeners.onconnect(handler);
+ handler.sendbuffer = _sendbuffer;
+ if bufferqueuelen > 0 then
+ return _senddbuffer();
+ end
+ end
+ end
return handler, socket
end