Comparison

net/server_epoll.lua @ 8091:acecf1413233

net.server_epoll: Reset onwritable before calling onconnect (fixes traceback if connection closed in onconnect)
author Kim Alvefur <zash@zash.se>
date Sun, 16 Apr 2017 02:36:42 +0200
parent 8008:62ed3795be13
child 8271:c09deab9989e
comparison
equal deleted inserted replaced
8090:00d1fb300c74 8091:acecf1413233
531 end); 531 end);
532 end 532 end
533 533
534 -- Connected! 534 -- Connected!
535 function interface:onconnect() 535 function interface:onconnect()
536 self.onwriteable = nil;
537 self:setflags(true, false);
536 if not self._connected then 538 if not self._connected then
537 self._connected = true; 539 self._connected = true;
538 self:on("connect"); 540 self:on("connect");
539 end 541 end
540 self.onwriteable = nil;
541 self:setflags(true, false);
542 return self:onwriteable(); 542 return self:onwriteable();
543 end 543 end
544 544
545 local function addserver(addr, port, listeners, pattern, tls) 545 local function addserver(addr, port, listeners, pattern, tls)
546 local conn, err = socket.bind(addr, port, cfg.tcp_backlog); 546 local conn, err = socket.bind(addr, port, cfg.tcp_backlog);