From d726ddbfb6981c18aa73449ea314a234189d35ac Mon Sep 17 00:00:00 2001 From: Izaya Date: Mon, 2 Jul 2018 01:16:07 +1000 Subject: [PATCH] more timeout-related bugfixes --- OpenOS/usr/lib/net.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OpenOS/usr/lib/net.lua b/OpenOS/usr/lib/net.lua index 06b46f1..d8445e1 100644 --- a/OpenOS/usr/lib/net.lua +++ b/OpenOS/usr/lib/net.lua @@ -53,6 +53,7 @@ local function cwrite(self,data) if self.state == "open" then if not net.send(self.addr,self.port,data) then self:close() + return false, "timed out" end end end @@ -90,7 +91,7 @@ local function socket(addr,port,sclose) end function net.open(to,port) - net.rsend(to,port,"openstream") + if not net.rsend(to,port,"openstream") then return false, "no ack from host" end local st = computer.uptime()+net.streamdelay local est = false while true do