Changeset

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
parents 2970:9b8e139eff5f
children 2973:61e103d99578 2976:15c056c1d9eb
files net/server_event.lua
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
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