From 8d4e240f6ae50d9b22ddc44f5e207018935da907 Mon Sep 17 00:00:00 2001 From: Diego Nehab Date: Tue, 8 Feb 2005 10:01:01 +0000 Subject: Forward server working on Mac OS X... --- doc/introduction.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'doc/introduction.html') diff --git a/doc/introduction.html b/doc/introduction.html index f8fe078..c88fa40 100644 --- a/doc/introduction.html +++ b/doc/introduction.html @@ -182,7 +182,7 @@ program. -- load namespace local socket = require("socket") -- create a TCP socket and bind it to the local host, at any port -local server = socket.try(socket.bind("*", 0)) +local server = assert(socket.bind("*", 0)) -- find out which port the OS chose for us local ip, port = server:getsockname() -- print a message informing what's up @@ -287,13 +287,13 @@ local host, port = "localhost", 13 -- load namespace local socket = require("socket") -- convert host name to ip address -local ip = socket.try(socket.dns.toip(host)) +local ip = assert(socket.dns.toip(host)) -- create a new UDP object -local udp = socket.try(socket.udp()) +local udp = assert(socket.udp()) -- contact daytime host -socket.try(udp:sendto("anything", ip, port)) +assert(udp:sendto("anything", ip, port)) -- retrieve the answer and print results -io.write(socket.try((udp:receive()))) +io.write(assert(udp:receive())) -- cgit v1.2.3-55-g6feb