Software /
code /
prosody
Comparison
net/server_epoll.lua @ 7591:138f16eb39fb
net.server_epoll: Improve syntax
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 18 Aug 2016 16:28:08 +0200 |
parent | 7590:fd07ab702f83 |
child | 7592:10d2f008321d |
comparison
equal
deleted
inserted
replaced
7590:fd07ab702f83 | 7591:138f16eb39fb |
---|---|
291 self:setflags(nil, false); | 291 self:setflags(nil, false); |
292 self:setwritetimeout(false); | 292 self:setwritetimeout(false); |
293 self:ondrain(); -- Be aware of writes in ondrain | 293 self:ondrain(); -- Be aware of writes in ondrain |
294 return; | 294 return; |
295 elseif partial then | 295 elseif partial then |
296 buffer[1] = data:sub(partial+1) | 296 buffer[1] = data:sub(partial+1); |
297 for i = #buffer, 2, -1 do | 297 for i = #buffer, 2, -1 do |
298 buffer[i] = nil; | 298 buffer[i] = nil; |
299 end | 299 end |
300 self:setwritetimeout(); | 300 self:setwritetimeout(); |
301 end | 301 end |
414 _pattern = pattern or server._pattern; | 414 _pattern = pattern or server._pattern; |
415 onwriteable = interface.onconnect; | 415 onwriteable = interface.onconnect; |
416 writebuffer = {}; | 416 writebuffer = {}; |
417 tls = tls; | 417 tls = tls; |
418 }, interface_mt); | 418 }, interface_mt); |
419 | |
419 if client.getpeername then | 420 if client.getpeername then |
420 conn.peername, conn.peerport = client:getpeername(); | 421 conn.peername, conn.peerport = client:getpeername(); |
421 end | 422 end |
422 if client.getsockname then | 423 if client.getsockname then |
423 conn.sockname, conn.sockport = client:getsockname(); | 424 conn.sockname, conn.sockport = client:getsockname(); |