mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-11 22:11:51 +00:00
update udp test
This commit is contained in:
parent
caf0ab9731
commit
a49d12565d
1 changed files with 2 additions and 2 deletions
|
|
@ -2,12 +2,12 @@ for i = 1, 3 do
|
||||||
print(string.format("iteration %s", i))
|
print(string.format("iteration %s", i))
|
||||||
local complete = false
|
local complete = false
|
||||||
|
|
||||||
local server = network.udp_open(8645, function (address, port, data, srv)
|
local server = network.udp_open(8645 + i, function (address, port, data, srv)
|
||||||
print(string.format("server received %s byte(s) from %s:%s", #data, address, port))
|
print(string.format("server received %s byte(s) from %s:%s", #data, address, port))
|
||||||
srv:send(address, port, "pong")
|
srv:send(address, port, "pong")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
network.udp_connect("localhost", 8645, function (data)
|
network.udp_connect("localhost", 8645 + i, function (data)
|
||||||
print(string.format("client received %s byte(s) from server", #data))
|
print(string.format("client received %s byte(s) from server", #data))
|
||||||
complete = true
|
complete = true
|
||||||
end, function (socket)
|
end, function (socket)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue