--- a/net/server_epoll.lua Sun Jan 01 19:41:03 2017 +0100
+++ b/net/server_epoll.lua Sun Jan 01 19:42:12 2017 +0100
@@ -572,6 +572,7 @@
return client;
end
+-- New outgoing TCP connection
local function addclient(addr, port, listeners, pattern, tls)
local conn, err = socket.tcp();
if not conn then return conn, err; end
@@ -582,6 +583,7 @@
return client, conn;
end
+-- Dump all data from one connection into another
local function link(from, to)
from.listeners = setmetatable({
onincoming = function (_, data)
@@ -604,6 +606,7 @@
self.send = new_send;
end
+-- Close all connections and servers
local function closeall()
for fd, conn in pairs(fds) do -- luacheck: ignore 213/fd
conn:close();