Software /
code /
prosody
Comparison
net/server_event.lua @ 5277:8585f3cc4976
net.server_event: Destroy interfaces immediately, fixes reopening of servers.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 28 Dec 2012 14:26:21 +0100 |
parent | 5276:8a207a7e52d3 |
child | 5286:0cbe57fbe2cd |
comparison
equal
deleted
inserted
replaced
5276:8a207a7e52d3 | 5277:8585f3cc4976 |
---|---|
118 -- Private methods | 118 -- Private methods |
119 function interface_mt:_position(new_position) | 119 function interface_mt:_position(new_position) |
120 self.position = new_position or self.position | 120 self.position = new_position or self.position |
121 return self.position; | 121 return self.position; |
122 end | 122 end |
123 function interface_mt:_close() -- regs event to start self:_destroy() | 123 function interface_mt:_close() |
124 local callback = function( ) | 124 return self:_destroy(); |
125 self:_destroy(); | |
126 self.eventclose = nil | |
127 return -1 | |
128 end | |
129 self.eventclose = addevent( base, nil, EV_TIMEOUT, callback, 0 ) | |
130 return true | |
131 end | 125 end |
132 | 126 |
133 function interface_mt:_start_connection(plainssl) -- should be called from addclient | 127 function interface_mt:_start_connection(plainssl) -- should be called from addclient |
134 local callback = function( event ) | 128 local callback = function( event ) |
135 if EV_TIMEOUT == event then -- timeout during connection | 129 if EV_TIMEOUT == event then -- timeout during connection |