~ubuntu-branches/ubuntu/jaunty/luatex/jaunty

« back to all changes in this revision

Viewing changes to src/libs/luasocket/samples/daytimeclnt.lua

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Preining
  • Date: 2008-07-07 11:01:13 UTC
  • mfrom: (1.1.5 upstream) (4.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080707110113-1y7lam37zbbb7bbt
Tags: 0.28.0-1
* two new upstream releases, see the respective ANNOUCE files
* add luasocket license statement to debian/copyright
* activate the pdfluatex format
* prepare for latex based formats
  - add the ini files from TeX Live
  - add debian/formats file
  - adjust dh_installtex incantation
  the problem is that luatex dies when loading ukrhypmp.tex from 
  texlive-lang-cyrillic, but we don't want to conflict with it by now.
* policy 3.8.0, rename README.Debian-source to README.source, and add
  notes about quilt usage
* disable patch fix-pwd-inclusion (it was from svn)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
-----------------------------------------------------------------------------
 
2
-- UDP sample: daytime protocol client
 
3
-- LuaSocket sample files
 
4
-- Author: Diego Nehab
 
5
-- RCS ID: $Id: daytimeclnt.lua,v 1.11 2004/06/21 06:07:57 diego Exp $
 
6
-----------------------------------------------------------------------------
 
7
local socket = require"socket"
 
8
host = host or "127.0.0.1"
 
9
port = port or 13
 
10
if arg then
 
11
    host = arg[1] or host
 
12
    port = arg[2] or port
 
13
end
 
14
host = socket.dns.toip(host)
 
15
udp = socket.udp()
 
16
print("Using host '" ..host.. "' and port " ..port.. "...")
 
17
udp:setpeername(host, port)
 
18
udp:settimeout(3)
 
19
sent, err = udp:send("anything")
 
20
if err then print(err) os.exit() end
 
21
dgram, err = udp:receive()
 
22
if not dgram then print(err) os.exit() end
 
23
io.write(dgram)