Diff

net/server_event.lua @ 2972:f9901175d535

net.server_event: Call listener.onconnect if it exists, otherwise stick to listener.onincoming
author Matthew Wild <mwild1@gmail.com>
date Sun, 11 Apr 2010 01:29:59 +0100
parent 2952:5069534f7f36
child 2988:0c61f73ac0fb
line wrap: on
line diff
--- a/net/server_event.lua	Sun Apr 11 01:11:42 2010 +0100
+++ b/net/server_event.lua	Sun Apr 11 01:29:59 2010 +0100
@@ -160,8 +160,8 @@
 			local callback = function( )
 				self:_lock( false,  false, false )
 				--vdebug( "start listening on client socket with id:", self.id )
-				self.eventread = addevent( base, self.conn, EV_READ, self.readcallback, cfg.READ_TIMEOUT )  -- register callback
-				self:onincoming()
+				self.eventread = addevent( base, self.conn, EV_READ, self.readcallback, cfg.READ_TIMEOUT );  -- register callback
+				(self.onconnect or self.onincoming)(self)
 				self.eventsession = nil
 				return -1
 			end