From 816de3fe24ca6dee46efa53c0d1e7e2cc70a2f5a Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 18 Aug 2016 16:00:51 +0200 Subject: net.server_epoll: Return something as FD when no connection exists --- net/server_epoll.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net/server_epoll.lua b/net/server_epoll.lua index f4ec54f6..4dc43bfa 100644 --- a/net/server_epoll.lua +++ b/net/server_epoll.lua @@ -141,7 +141,10 @@ function interface:on(what, ...) end function interface:getfd() - return self.conn:getfd(); + if self.conn then + return self.conn:getfd(); + end + return -1; end function interface:ip() -- cgit v1.2.3