Software /
code /
prosody
Comparison
net/server_select.lua @ 6383:ec8878113907
Merge 0.10->trunk
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Tue, 02 Sep 2014 22:34:32 +0200 |
parent | 6316:e144a1b67c30 |
parent | 6382:57d23c26039b |
child | 6442:0f4025abbe8f |
comparison
equal
deleted
inserted
replaced
6372:305226a9e581 | 6383:ec8878113907 |
---|---|
284 local dispatch = listeners.onincoming | 284 local dispatch = listeners.onincoming |
285 local status = listeners.onstatus | 285 local status = listeners.onstatus |
286 local disconnect = listeners.ondisconnect | 286 local disconnect = listeners.ondisconnect |
287 local drain = listeners.ondrain | 287 local drain = listeners.ondrain |
288 local onreadtimeout = listeners.onreadtimeout; | 288 local onreadtimeout = listeners.onreadtimeout; |
289 local detach = listeners.ondetach | |
289 | 290 |
290 local bufferqueue = { } -- buffer array | 291 local bufferqueue = { } -- buffer array |
291 local bufferqueuelen = 0 -- end of buffer array | 292 local bufferqueuelen = 0 -- end of buffer array |
292 | 293 |
293 local toclose | 294 local toclose |
315 return disconnect | 316 return disconnect |
316 end | 317 end |
317 handler.onreadtimeout = onreadtimeout; | 318 handler.onreadtimeout = onreadtimeout; |
318 | 319 |
319 handler.setlistener = function( self, listeners ) | 320 handler.setlistener = function( self, listeners ) |
321 if detach then | |
322 detach(self) -- Notify listener that it is no longer responsible for this connection | |
323 end | |
320 dispatch = listeners.onincoming | 324 dispatch = listeners.onincoming |
321 disconnect = listeners.ondisconnect | 325 disconnect = listeners.ondisconnect |
322 status = listeners.onstatus | 326 status = listeners.onstatus |
323 drain = listeners.ondrain | 327 drain = listeners.ondrain |
324 handler.onreadtimeout = listeners.onreadtimeout | 328 handler.onreadtimeout = listeners.onreadtimeout |
329 detach = listeners.ondetach | |
325 end | 330 end |
326 handler.getstats = function( ) | 331 handler.getstats = function( ) |
327 return readtraffic, sendtraffic | 332 return readtraffic, sendtraffic |
328 end | 333 end |
329 handler.ssl = function( ) | 334 handler.ssl = function( ) |