1
0
mirror of https://github.com/AR2000AR/openComputers_codes.git synced 2025-09-08 14:41:14 +02:00

[osinetwrok] fix bug in udp

fixed : one char was lost in the udp payload
This commit is contained in:
2023-07-19 14:44:31 +02:00
parent 8dcf885032
commit 206e4116d1
6 changed files with 7 additions and 61 deletions

View File

@@ -60,6 +60,7 @@ end
---@return string? datagram, string? fromAddress, number? fromPort
function UDPSocket:receivefrom(size)
--TODO : use the size
if (select(2, self:getsockname()) == 0) then
error("Reciving object before binding to a address/port", 2)
end
@@ -156,6 +157,8 @@ function UDPSocket:setoption(option, value)
error("NOT IMPLEMENTED", 2)
end
---Set the socket's timeout in second
---@param value number seconds
function UDPSocket:settimeout(value)
checkArg(1, value, 'number')
self._timeout = value * 100