mirror of
https://github.com/ShadowKatStudios/OC-Minitel.git
synced 2024-11-23 02:28:05 +11:00
more #3 related stuff, this time adding the improvements to the KOS NEO version
This commit is contained in:
parent
ad3c6d8433
commit
3a769628e6
@ -5,6 +5,8 @@ echo miniprompt.lua
|
||||
lua minify.lua miniprompt.lua mini-miniprompt.lua
|
||||
echo fget.lua
|
||||
lua minify.lua fget.lua mini-fget.lua
|
||||
echo ufs.lua
|
||||
lua minify.lua ufs.lua mini-ufs.lua
|
||||
echo init-wrapper.lua
|
||||
lua minify.lua init-wrapper.lua mini-init-wrapper.lua
|
||||
echo microtel-3.lua
|
||||
|
@ -16,7 +16,7 @@ function read()
|
||||
if tSignal[3] > 31 and tSignal[3] < 127 then
|
||||
write(string.char(tSignal[3]))
|
||||
sBuffer = sBuffer .. string.char(tSignal[3])
|
||||
elseif tSignal[3] == 8 and tSignal[4] == 14 and S:len() > 0 then
|
||||
elseif tSignal[3] == 8 and tSignal[4] == 14 and sBuffer:len() > 0 then
|
||||
write("\8 \8")
|
||||
sBuffer = sBuffer:sub(1,-2)
|
||||
end
|
||||
|
@ -47,7 +47,7 @@ local listener = false
|
||||
local dbug = false
|
||||
local modems = {}
|
||||
local port = 4096
|
||||
local retry = 30
|
||||
local retry = 10
|
||||
local route = true
|
||||
|
||||
--[[
|
||||
@ -60,7 +60,7 @@ address {
|
||||
]]--
|
||||
local sroutes = {}
|
||||
local rcache = setmetatable({},{__index=sroutes})
|
||||
local rctime = 30
|
||||
local rctime = 15
|
||||
|
||||
--[[
|
||||
packet queue format:
|
||||
|
@ -50,11 +50,13 @@ function net.usend(to,port,data,npID)
|
||||
end
|
||||
|
||||
function net.rsend(to,port,data)
|
||||
local pid = net.genPacketID()
|
||||
minitel.sendPacket(1,to,port,data,pid)
|
||||
local pid, stime = net.genPacketID(), computer.uptime() + net.streamdelay
|
||||
computer.pushSignal("net_send",1,to,port,data,pid)
|
||||
repeat
|
||||
_,rpid = svcpull("net_ack")
|
||||
until rpid == pid
|
||||
until rpid == pid or computer.uptime() > stime
|
||||
if not rpid then return false end
|
||||
return true
|
||||
end
|
||||
|
||||
-- ordered packet delivery, layer 4?
|
||||
@ -70,8 +72,9 @@ function net.send(to,port,ldata)
|
||||
tdata = {ldata}
|
||||
end
|
||||
for k,v in ipairs(tdata) do
|
||||
net.rsend(to,port,v)
|
||||
if not net.rsend(to,port,v) then return false end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
-- socket stuff, layer 5?
|
||||
|
@ -34,7 +34,7 @@ address {
|
||||
]]--
|
||||
local sroutes = {}
|
||||
local rcache = setmetatable({},{__index=sroutes})
|
||||
local rctime = 30
|
||||
local rctime = 15
|
||||
|
||||
--[[
|
||||
packet queue format:
|
||||
@ -51,7 +51,7 @@ local pqueue = {}
|
||||
|
||||
-- packet cache: [packet ID]=uptime
|
||||
local pcache = {}
|
||||
local pctime = 15
|
||||
local pctime = 30
|
||||
|
||||
local function dprint(...)
|
||||
if dbug then
|
||||
|
Loading…
Reference in New Issue
Block a user