aboutsummaryrefslogtreecommitdiff
path: root/test/unixdgramclnt.lua
diff options
context:
space:
mode:
authorDiego Nehab <diego.nehab@gmail.com>2017-01-04 18:41:31 -0200
committerGitHub <noreply@github.com>2017-01-04 18:41:31 -0200
commita0baab5f3c041afdb66bbda951a07943b022d4ca (patch)
treee481f825991151cd164435faeb4b5e1b779526ae /test/unixdgramclnt.lua
parentac3201d62024b397e8d6e3376822176d681811ec (diff)
parent3a33c37b9ce852d0b3531e82c6ffdb47bb937f0a (diff)
downloadluasocket-a0baab5f3c041afdb66bbda951a07943b022d4ca.tar.gz
luasocket-a0baab5f3c041afdb66bbda951a07943b022d4ca.tar.bz2
luasocket-a0baab5f3c041afdb66bbda951a07943b022d4ca.zip
Merge pull request #199 from enginix/master
Rename unix.tcp to unix.stream, unix.udp to unix.dgram
Diffstat (limited to 'test/unixdgramclnt.lua')
-rw-r--r--test/unixdgramclnt.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/unixdgramclnt.lua b/test/unixdgramclnt.lua
new file mode 100644
index 0000000..9bd60f7
--- /dev/null
+++ b/test/unixdgramclnt.lua
@@ -0,0 +1,9 @@
1socket = require"socket"
2socket.unix = require"socket.unix"
3c = assert(socket.unix.dgram())
4print(c:bind("/tmp/bar"))
5while 1 do
6 local l = io.read("*l")
7 assert(c:sendto(l, "/tmp/foo"))
8 print(assert(c:receivefrom()))
9end