diff options
author | enginix <wnd1024@gmail.com> | 2016-12-25 23:15:12 +0800 |
---|---|---|
committer | enginix <wnd1024@gmail.com> | 2016-12-25 23:33:10 +0800 |
commit | 3a33c37b9ce852d0b3531e82c6ffdb47bb937f0a (patch) | |
tree | e481f825991151cd164435faeb4b5e1b779526ae /test/unixdgramclnt.lua | |
parent | ac3201d62024b397e8d6e3376822176d681811ec (diff) | |
download | luasocket-3a33c37b9ce852d0b3531e82c6ffdb47bb937f0a.tar.gz luasocket-3a33c37b9ce852d0b3531e82c6ffdb47bb937f0a.tar.bz2 luasocket-3a33c37b9ce852d0b3531e82c6ffdb47bb937f0a.zip |
rename unix.tcp to unix.stream, unix.udp to unix.dgram
Diffstat (limited to 'test/unixdgramclnt.lua')
-rw-r--r-- | test/unixdgramclnt.lua | 9 |
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 @@ | |||
1 | socket = require"socket" | ||
2 | socket.unix = require"socket.unix" | ||
3 | c = assert(socket.unix.dgram()) | ||
4 | print(c:bind("/tmp/bar")) | ||
5 | while 1 do | ||
6 | local l = io.read("*l") | ||
7 | assert(c:sendto(l, "/tmp/foo")) | ||
8 | print(assert(c:receivefrom())) | ||
9 | end | ||