Comparison

net/server_select.lua @ 6382:57d23c26039b

Merge 0.9->0.10
author Kim Alvefur <zash@zash.se>
date Tue, 02 Sep 2014 22:33:11 +0200
parent 6315:7a3e2f2d43fc
parent 6381:9ffd582c65d8
child 6383:ec8878113907
child 6433:b93402cec1c4
comparison
equal deleted inserted replaced
6377:50e5aed4eeea 6382:57d23c26039b
283 local dispatch = listeners.onincoming 283 local dispatch = listeners.onincoming
284 local status = listeners.onstatus 284 local status = listeners.onstatus
285 local disconnect = listeners.ondisconnect 285 local disconnect = listeners.ondisconnect
286 local drain = listeners.ondrain 286 local drain = listeners.ondrain
287 local onreadtimeout = listeners.onreadtimeout; 287 local onreadtimeout = listeners.onreadtimeout;
288 local detach = listeners.ondetach
288 289
289 local bufferqueue = { } -- buffer array 290 local bufferqueue = { } -- buffer array
290 local bufferqueuelen = 0 -- end of buffer array 291 local bufferqueuelen = 0 -- end of buffer array
291 292
292 local toclose 293 local toclose
314 return disconnect 315 return disconnect
315 end 316 end
316 handler.onreadtimeout = onreadtimeout; 317 handler.onreadtimeout = onreadtimeout;
317 318
318 handler.setlistener = function( self, listeners ) 319 handler.setlistener = function( self, listeners )
320 if detach then
321 detach(self) -- Notify listener that it is no longer responsible for this connection
322 end
319 dispatch = listeners.onincoming 323 dispatch = listeners.onincoming
320 disconnect = listeners.ondisconnect 324 disconnect = listeners.ondisconnect
321 status = listeners.onstatus 325 status = listeners.onstatus
322 drain = listeners.ondrain 326 drain = listeners.ondrain
323 handler.onreadtimeout = listeners.onreadtimeout 327 handler.onreadtimeout = listeners.onreadtimeout
328 detach = listeners.ondetach
324 end 329 end
325 handler.getstats = function( ) 330 handler.getstats = function( )
326 return readtraffic, sendtraffic 331 return readtraffic, sendtraffic
327 end 332 end
328 handler.ssl = function( ) 333 handler.ssl = function( )