From 97b26e0b66c840a446a0179200c7df23565330d1 Mon Sep 17 00:00:00 2001 From: Diego Nehab Date: Sun, 2 Jan 2005 22:44:00 +0000 Subject: Almost ready to release beta3 --- samples/echoclnt.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'samples/echoclnt.lua') 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 port = arg[2] or port end host = socket.dns.toip(host) -udp = socket.try(socket.udp()) -socket.try(udp:setpeername(host, port)) +udp = assert(socket.udp()) +assert(udp:setpeername(host, port)) print("Using remote host '" ..host.. "' and port " .. port .. "...") while 1 do line = io.read() - if not line then os.exit() end - socket.try(udp:send(line)) - dgram = socket.try(udp:receive()) + if not line or line == "" then os.exit() end + assert(udp:send(line)) + dgram = assert(udp:receive()) print(dgram) end -- cgit v1.2.3-55-g6feb