You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
local socket = require("socket")
local ip, port = "127.0.0.1", 9999
local udp = assert(socket.udp())
udp:setsockname(ip, port)
while 1 do
a = assert(udp:receive());
print(a);
end
And a transmitter code:
local socket = require("socket")
local ip, port = "127.0.0.1", 9999
local udp = assert(socket.udp())
udp:setpeername(ip, port)
a = ""
for ii = 1,10000 do
a = a .. " " .. ii
end
--udp:sendto(a, ip, port)
udp:send(a)
udp:close()
Using this code, I can only send 8193 bytes. First question is: Why?
Now, if I remove udp:setpeername(ip, port)
and use: udp:sendto(a, ip, port)
I do not receive anything! Second question: Why?
The text was updated successfully, but these errors were encountered:
Hello,
I am new to Lua here.
I have a receiver side code:
And a transmitter code:
Using this code, I can only send 8193 bytes. First question is: Why?
Now, if I remove
udp:setpeername(ip, port)
and use:
udp:sendto(a, ip, port)
I do not receive anything!
Second question: Why?
The text was updated successfully, but these errors were encountered: