aboutsummaryrefslogtreecommitdiff
path: root/samples/echoclnt.lua
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2005-01-02 22:44:00 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2005-01-02 22:44:00 +0000
commit97b26e0b66c840a446a0179200c7df23565330d1 (patch)
tree272f9ea0451f13b563451fb8df21a03669e90d09 /samples/echoclnt.lua
parenta8254e94f8c14ac15b02be53a1cc69ba80899230 (diff)
downloadluasocket-97b26e0b66c840a446a0179200c7df23565330d1.tar.gz
luasocket-97b26e0b66c840a446a0179200c7df23565330d1.tar.bz2
luasocket-97b26e0b66c840a446a0179200c7df23565330d1.zip
Almost ready to release beta3
Diffstat (limited to 'samples/echoclnt.lua')
-rw-r--r--samples/echoclnt.lua10
1 files changed, 5 insertions, 5 deletions
diff --git a/samples/echoclnt.lua b/samples/echoclnt.lua
index 038061d..764e433 100644
--- a/samples/echoclnt.lua
+++ b/samples/echoclnt.lua
@@ -12,13 +12,13 @@ if arg then
12 port = arg[2] or port 12 port = arg[2] or port
13end 13end
14host = socket.dns.toip(host) 14host = socket.dns.toip(host)
15udp = socket.try(socket.udp()) 15udp = assert(socket.udp())
16socket.try(udp:setpeername(host, port)) 16assert(udp:setpeername(host, port))
17print("Using remote host '" ..host.. "' and port " .. port .. "...") 17print("Using remote host '" ..host.. "' and port " .. port .. "...")
18while 1 do 18while 1 do
19 line = io.read() 19 line = io.read()
20 if not line then os.exit() end 20 if not line or line == "" then os.exit() end
21 socket.try(udp:send(line)) 21 assert(udp:send(line))
22 dgram = socket.try(udp:receive()) 22 dgram = assert(udp:receive())
23 print(dgram) 23 print(dgram)
24end 24end