diff options
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/luasocket/test/udpconnectsrvr.lua')
-rw-r--r-- | Build/source/texk/web2c/luatexdir/luasocket/test/udpconnectsrvr.lua | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/test/udpconnectsrvr.lua b/Build/source/texk/web2c/luatexdir/luasocket/test/udpconnectsrvr.lua new file mode 100644 index 00000000000..5a9772ec6c4 --- /dev/null +++ b/Build/source/texk/web2c/luatexdir/luasocket/test/udpconnectsrvr.lua @@ -0,0 +1,16 @@ +local socket = require"socket" +local udp = socket.udp +local localhost = "127.0.0.1" +local s = assert(udp()) +assert(tostring(s):find("udp{unconnected}")) +print("setpeername", s:setpeername(localhost, 5061)) +print("getsockname", s:getsockname()) +assert(tostring(s):find("udp{connected}")) +print(s:receive()) +print("setpeername", s:setpeername("*")) +print("getsockname", s:getsockname()) +s:sendto("a", localhost, 12345) +print("getsockname", s:getsockname()) +assert(tostring(s):find("udp{unconnected}")) +print(s:receivefrom()) +s:close() |