Comparison

net/server_event.lua @ 9385:58fe099043ed

net.server: Call a 'onattach' callback when replacing listeners
author Kim Alvefur <zash@zash.se>
date Wed, 26 Sep 2018 14:25:59 +0200
parent 8983:23f66f04e216
child 9387:33e52f727f0f
comparison
equal deleted inserted replaced
9384:5c8006ce8cb8 9385:58fe099043ed
422 self.onincoming = listener.onincoming; 422 self.onincoming = listener.onincoming;
423 self.ontimeout = listener.ontimeout; 423 self.ontimeout = listener.ontimeout;
424 self.onreadtimeout = listener.onreadtimeout; 424 self.onreadtimeout = listener.onreadtimeout;
425 self.onstatus = listener.onstatus; 425 self.onstatus = listener.onstatus;
426 self.ondetach = listener.ondetach; 426 self.ondetach = listener.ondetach;
427 self.onattach = listener.onattach;
427 self.ondrain = listener.ondrain; 428 self.ondrain = listener.ondrain;
429 self:onattach();
428 end 430 end
429 431
430 -- Stub handlers 432 -- Stub handlers
431 function interface_mt:onconnect() 433 function interface_mt:onconnect()
432 end 434 end
443 self.eventread = nil 445 self.eventread = nil
444 end 446 end
445 function interface_mt:ondrain() 447 function interface_mt:ondrain()
446 end 448 end
447 function interface_mt:ondetach() 449 function interface_mt:ondetach()
450 end
451 function interface_mt:onattach()
448 end 452 end
449 function interface_mt:onstatus() 453 function interface_mt:onstatus()
450 end 454 end
451 455
452 -- End of client interface methods 456 -- End of client interface methods