From e0c9c76b44e32e17f17b06e546e5283728fdb706 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Sun, 11 Apr 2010 01:29:59 +0100 Subject: net.server_event: Call listener.onconnect if it exists, otherwise stick to listener.onincoming --- net/server_event.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/server_event.lua b/net/server_event.lua index 5e62f3fd..be9e7f0a 100644 --- a/net/server_event.lua +++ b/net/server_event.lua @@ -160,8 +160,8 @@ do 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 -- cgit v1.2.3