~ubuntu-branches/ubuntu/intrepid/luatex/intrepid

« back to all changes in this revision

Viewing changes to src/libs/luasocket/samples/echoclnt.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: echo protocol client
 
3
-- LuaSocket sample files
 
4
-- Author: Diego Nehab
 
5
-- RCS ID: $Id: echoclnt.lua,v 1.10 2005/01/02 22:44:00 diego Exp $
 
6
-----------------------------------------------------------------------------
 
7
local socket = require("socket")
 
8
host = host or "localhost"
 
9
port = port or 7
 
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 = assert(socket.udp())
 
16
assert(udp:setpeername(host, port))
 
17
print("Using remote host '" ..host.. "' and port " .. port .. "...")
 
18
while 1 do
 
19
        line = io.read()
 
20
        if not line or line == "" then os.exit() end
 
21
        assert(udp:send(line))
 
22
        dgram = assert(udp:receive())
 
23
        print(dgram)
 
24
end