Comparison

net/server_epoll.lua @ 7551:838212918f11

net.server_epoll: Rename arguments and varibles for consistensy
author Kim Alvefur <zash@zash.se>
date Wed, 10 Aug 2016 20:55:07 +0200
parent 7550:8c2bc1b6d84a
child 7552:f1ae74ebeb81
comparison
equal deleted inserted replaced
7550:8c2bc1b6d84a 7551:838212918f11
445 fds[server:getfd()] = server; 445 fds[server:getfd()] = server;
446 return server; 446 return server;
447 end 447 end
448 448
449 -- COMPAT 449 -- COMPAT
450 local function wrapclient(client, addr, port, listeners, mode, tls) 450 local function wrapclient(conn, addr, port, listeners, pattern, tls)
451 local conn = setmetatable({ 451 local client = setmetatable({
452 conn = client; 452 conn = conn;
453 created = gettime(); 453 created = gettime();
454 listeners = listeners; 454 listeners = listeners;
455 _pattern = mode; 455 _pattern = pattern;
456 writebuffer = {}; 456 writebuffer = {};
457 tls = tls; 457 tls = tls;
458 onreadable = interface.onconnect; 458 onreadable = interface.onconnect;
459 onwriteable = interface.onconnect; 459 onwriteable = interface.onconnect;
460 peer = { addr, port }; 460 peer = { addr, port };
461 }, interface_mt); 461 }, interface_mt);
462 fds[conn:getfd()] = conn; 462 fds[client:getfd()] = client;
463 conn:setflags(true, true); 463 client:setflags(false, true);
464 return conn; 464 return client;
465 end 465 end
466 466
467 local function link(from, to) 467 local function link(from, to)
468 from.listeners = setmetatable({ 468 from.listeners = setmetatable({
469 onincoming = function (_, data) 469 onincoming = function (_, data)