| Andreas Rozek |
|
Socket_01 - Data Transfer between UDP Sockets"Socket_01" demonstrates the data transfer between UDP sockets - for that purpose, the program creates two such sockets and sends a short message from one socket to the other. The program is simple enough not to require any additional explanation. "Socket_01" should be invoked without any command line arguments lua Socket_01.lua and produces the following output: Socket_01 - a first experiment with UDP datagrams creating receiver socket... done (Address: 0.0.0.0, Port: 1267) creating sender socket... done (Address: 0.0.0.0, Port: 1268) sending datagram... done receiving datagram... done (got "Hello" from 127.0.0.1:1268) The actually shown port numbers may vary from one invocation to the other and from system to system. Source CodeThe source code of this example is available for download:
References
|
| http://www.Andreas-Rozek.de/Lua/Acquainting/Socket_01_en.html | (last Modification: 15.04.2002) |