1
0
mirror of https://github.com/Adorable-Catgirl/Zorya-NEO.git synced 2024-12-25 02:18:06 +11:00
Zorya-NEO/lib/net_minitel/microtel/microtel-5-open-mini.lua

15 lines
335 B
Lua
Raw Normal View History

2020-01-09 15:01:35 +11:00
net.timeout=60
function net.open(A,V)
local st,F,P,D=computer.uptime()
net.send(A,V,"openstream")
repeat
_,F,P,D=computer.pullSignal(0.5)
if computer.uptime()>st+net.timeout then return false end
until F==A and P==V and tonumber(D)
V=tonumber(D)
repeat
_,F,P,D=computer.pullSignal(0.5)
until F==A and P==V
return net.socket(A,V,D)
end