Comparison

net/server_event.lua @ 2114:737763dc23b0

net.server_event: Call connection's onconnect, no need to pass closures around now
author Matthew Wild <mwild1@gmail.com>
date Sun, 22 Nov 2009 03:44:15 +0000
parent 2113:cbf7241a0f6a
child 2115:2d377ff72f79
comparison
equal deleted inserted replaced
2113:cbf7241a0f6a 2114:737763dc23b0
159 if self.type == "client" then 159 if self.type == "client" then
160 local callback = function( ) 160 local callback = function( )
161 self:_lock( false, false, false ) 161 self:_lock( false, false, false )
162 --vdebug( "start listening on client socket with id:", self.id ) 162 --vdebug( "start listening on client socket with id:", self.id )
163 self.eventread = addevent( base, self.conn, EV_READ, self.readcallback, cfg.READ_TIMEOUT ) -- register callback 163 self.eventread = addevent( base, self.conn, EV_READ, self.readcallback, cfg.READ_TIMEOUT ) -- register callback
164 onconnect( self ) 164 self:onconnect()
165 self.eventsession = nil 165 self.eventsession = nil
166 return -1 166 return -1
167 end 167 end
168 self.eventsession = addevent( base, nil, EV_TIMEOUT, callback, 0 ) 168 self.eventsession = addevent( base, nil, EV_TIMEOUT, callback, 0 )
169 else 169 else