Changeset

2971:e21c546368bd

Merge 0.7->trunk
author Matthew Wild <mwild1@gmail.com>
date Sun, 11 Apr 2010 01:20:20 +0100
parents 2969:81991c04a056 (current diff) 2970:9b8e139eff5f (diff)
children 2973:61e103d99578
files
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/net/server_select.lua	Fri Apr 09 12:32:25 2010 +0100
+++ b/net/server_select.lua	Sun Apr 11 01:20:20 2010 +0100
@@ -611,7 +611,16 @@
 
 	_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