Contents
TCPStream
- a C++ standard iostream
over a TCP channel
get-url
and web agents in Scheme [a separate document]
A simple code for relaying TCP packets. One can use it as an illustration of
asynchronous I/O on a TCP channel.
The code also sports a finite state
machine, which does the actual stream pumping and handles related
errors and special conditions.
The program contains a set of classes to open active/passive TCP
connections, do straight/reverse DNS and other networking chores. The
code has many comments.
| |
Platforms | |
---|---|
Sun/Solaris 2.4, HP-UX B.10.10, g++ v2.7.2 | |
Version | |
The current version is 1.3, April 1995. | |
References | |
Complete source code archive off this site [.shar.gz , 8K]
| |
Other references | |
|
A set of classes (C++ streams ) that perform:
There are also a few convenience functions/classes. The code is written in a portable way and rather commented; verification tests are provided as well. | |
Platforms | |
---|---|
i686/FreeBSD 4.9, gcc 3.2 i686/Linux 2.4.21, gcc 3.2.3 (and, reportedly, Fedora Core 2 with gcc 3.3.3 and 3.4.0) i686/FreeBSD 4.0, gcc 2.95.2 various commercial UNIX flavors (Sun/Solaris 2.6, HP-UX B.10.10) with gcc 2.95.2 Mac and PowerMac: CodeWarrior 11 Win95/WinNT: Visual C++ 6.0 BEOS R4b4 | |
License Type | |
Public Domain | |
Version | |
The current version is 2.7, June 26, 2005. | |
References | |
The README file [plain text file] Complete source code
archive [ |
exec_with_piped is a tool that turns any UNIX-interactive application into a server, which runs as a single background process accepting sequences of commands from a number of clients (applications or scripts). One example of a UNIX-interactive application is telnet : this makes it possible to script remote daemons.
Executing a shell command feeding from a named FIFO pipe is trivial, except for one pitfall, as an article "Scripting daemons through pipes; e.g.: newsreader in sh? (yes!)" explains. The article also shows off a few
| |
Version | |
---|---|
The current version is 1.4, Nov 14, 1997. | |
References | |
pipe_scripting.shar [10K] that contains
a USENET article explaining the technique, posted on comp.unix.programmer, comp.unix.admin, comp.unix.internals, comp.unix.shell newsgroups on Jan 24, 1996.
"The most primitive and nearly universal database interface", |
TCPStream
- a C++ standard iostream
over a TCP channel
TCPStream is a standard C++ stream to push data to and take
data from a TCP connection. A TCPStream assumes a half-duplex mode, so to speak. This is the mode in which all transaction- or request-reply-
oriented TCP protocols -- HTTP, SMTP, POP, NNTP, RPC over TCP, to name
just very few -- operate. This mode implies that reads and writes
from/to a channel can share the same buffer. A "get" operation tacitly
flushes all the data deposited by prior "put" operations. Similarly
a "put" operation discards all the previously read but not yet
consumed data.
The functionality of With the TCPstream link; link.connect(SocketAddr("hostname",110)); if( !link.is_open() || !link ) _error("Failed to establish the connection"); link << "USER " << user_name << endl; int resp_code; char buffer[100]; link >> resp_code; if( ! link.get(buffer,sizeof(buffer)-1,'\r').good() ) _error("error reading a response line from the link"); if( resp_code >= 300 ) _error("bummer"); ...etc...See a validation code file vTCPstream.cc for more examples. TCP streams are helpful on a server side as well. See
| |
Version | |
---|---|
The current version is 2.6, November 19, 2000. | |
References | |
Advanced i/o and Arithmetic Compression classlib HTTP Virtual File System |
This code is a scripting tool to talk to any TCP server: an HTTP daemon, a finger daemon, or any other RPC-like service. The tool brings benefits of the TCPStream class to a command line, sh or other scripts.
This code is to perform a single transaction -- a request/reply exchange -- with a "server" on the other end of a TCP pipe. The tool establishes a connection to a server, sends a request, listens to the reply, and prints it on its standard output. Examples:
| |
Platforms | |
---|---|
various flavors of UNIX (Sun/Solaris 2.6, HP-UX B.10.xx) , FreeBSD 4.0, Linux 2.2.xx, Win9x/WinNT, BeOS
| |
Version | |
The current version is 1.2, January 4, 2000. | |
References | |
source code archive off this site [ |
This is a source code archive that accompanies a DDJ article "Distributing Data Using TLT30G". TLT30G is a software system for distributing files from a central location to a number of clients over unidirectional, noisy, and generally slow communication links. The code archive is a self-contained implementation of a particular transport layer of the TLT30G broadcasting system. This Link Access Plugin implements transmission of TLT30G's segments as UDP datagrams over a TCP/IP network. Of all the protocols of the TCP/IP suite, UDP fits best for a packet-oriented broadcast without any feedback. The code in the archive below defines and implements basic network classes ( | |
Platforms | |
---|---|
Sun/Solaris 2.4, HP-UX B.10.10, g++ v2.7.2 | |
Version | |
The current version is 1.2, August 1996. | |
References | |
LAPNet source code archive off this site [.tar.gz , 12K]
| |
Other references | |
|
An article that shows off a tail-f CGI script that starts a Server-Net-Browser hyper-computer. The article argues that the Web itself may act as some sort of a distributed, multi-threaded hyper-computer.Keywords: Finite Automaton, FSM, HTTP, Scheme, CGI, Computation, WWW, Push | |
Version | |
---|---|
The current version is 2.0, Mar 21, 1997. | |
References | |
tail-f.scm script's description A USENET article explaining the technique [plain text file], |
oleg-at-okmij.org