server_epoll: Add some comments describing some functions
authorKim Alvefur <zash@zash.se>
Sun, 01 Jan 2017 19:42:12 +0100
changeset 7803 dadf9ba290c5
parent 7802 93643a61858a
child 7806 4d182b9a8109
server_epoll: Add some comments describing some functions
net/server_epoll.lua
--- 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();