Tcp4u was written by Philippe Jounin and Laurent Le Bras and is Copyrighted
1994-1997 by them. The authors disclaim all liability for its use or for
problems, data corruption, data loss, or other loss that may result from its
use.
This program is free software; you can redistribute it and/or modify it
under the terms the GNU General Public License as published
by the Free Software Foundation; either version 1, or (at
your option) any later version.
To receive a copy of the GNU General Public License write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Tcp4u provides portable APIs which allow an easy use of the following IETF
protocols :
This new version provides a better interface for UDP APIs (one step closer TFTP
APIs!).
see Udp4uServiceToPort and UdpInit.
Numerous logging facilities have been added. See Tcp4uEnableLog.
The Tcp4u functions have been compiled and tested under the following operating
system:
Tcp4u is available at the following sites :
ftp://papa.indstate.edu/winsock-l/Windows95/Develop and its mirrors
http://download.com
Updates or add-ons are available from my home page :
http://www.magic.fr/~jounin-ph
Since Tcp4u is freeware, it has no official support. However, i try to help you
as best as i can. Thus if you have some problem, please send your comments to
ph.jounin@computer.org.
If you find errors in the documentation, please be lenient: First i am French,
furthermore i do not like write docs files (but who does?). Send me the
corrected text, i will update this documentation for the next release.
If you intend to use Tcp4u under Unix, you have to compile the library. Please
refer to the file Unix/INSTALL. Then you should have the following files :
Since Tcp4u was originally written for Windows, its uses Windows types. Their
definitions are given in the file tcp4u.h. The most widely used are:
SOCKET
|
a
16 bit-unsigned integer
|
LPSTR
|
a
pointer to a variable memory location
|
LPCSTR
|
a
pointer to a non-writeable memory location
|
The first function that an application should call is Tcp4uInit. It
allocates buffers and get some information about the task which has called it.
The task is ready to open connections.
The application can now establish connections with a remote server with
TcpConnect (client) or wait for an incoming connection with both
TcpGetListenSocket and TcpAccept. It can either use any HTTP functions.
Before quitting, the application must close opened sockets with TcpClose, and
call Tcp4uCleanup.
This table lists alphabetically all the functions implemented in this version.
The remainder
of the documentation describes them one by one.
Tcp4uCleanup
|
Last
function to be called, frees local resources
|
Tcp4uEnableLog
|
Allows
tracing of received/sent frames and functions
|
Tcp4uInit
|
First
function to be called
|
Tcp4uVer
|
Gives
the 2-part version of the library (packed into an int).
|
TcpGetLocalID
|
Returns
name and address of the local host
|
Tcp4uErrorString
|
Returns
error string about an error code
|
TcpAbort
|
Aborts
the current blocking call
|
TcpAccept
|
Waits
for a incoming connection
|
TcpClose
|
Closes
a socket
|
TcpConnect
|
Establishes
a connection to a peer
|
TcpFlush
|
Flushes
the buffer associated with a socket
|
TcpGetListenSocket
|
Creates
a socket and listen for incoming connection
|
TcpGetRemoteID
|
Returns
name and address of the connected host
|
TcpIsDataAvail
|
Returns
TRUE if unread data are available
|
TcpIsOOBDataAvail
|
Returns
TRUE if unread Out of Band data are available
|
TcpPPRecv
|
Receives
data with length of frame in the two first bytes
|
TcpPPSend
|
Sends
data, the two first bytes of the frame are its length
|
TcpRecv
|
Receives
data
|
TcpRecvUntilStr
|
Receives
data until a given character/string
|
TcpSend
|
Sends
data to connected host
|
TnGetAnswerCode
|
Receives
data until end of a Telnet frame
|
TnReadLine
|
Receives
data until an end of line (10 ASCII)
|
TnReadMultiLine
|
Receives
a full Tenet frame
|
TnSend
|
Sends
a 0-terminated string
|
Http4uErrorString
|
Returns
an error string about a HTTP return code
|
Http4uSetBufferSize
|
Changes
the internal buffer size
|
Http4uSetTimeout
|
Changes
the internal timeout
|
HttpGetFile
|
Retrieves
a file using the HTTP protocol
|
HttpGetFileEx
|
Retrieves
both files and headers using the HTTP protocol
|
Udp4uServiceToPort
|
Translates
a service into a port identifier
|
UdpBind
|
Forces
a socket to communicate only with a given host
|
UdpCleanup
|
Destroys
the local UDP socket
|
UdpInit
|
Creates
a local UDP socket
|
UdpSend
|
sends
a datagram to a previously given host
|
UdpRecv
|
Receives
or wait for a datagram
|