Tcp4u was written by Philippe Jounin and Laurent Le Bras and is Copyrighted 1996-1998 by them.
This library is free software; you can redistribute it and/or modify it under the terms the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.
You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Tcp4u provides portable APIs which allow an easy use of the following IETF protocols :
The Tcp4u functions have been compiled and tested under the following operating system:
Tcp4u is available at the following sites :
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 Philippe Jounin.
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 |
far |
This attribute is only meaningful for Windows 3.1. |
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 |
TnProtoExchange
|
Completes a full telnet dialog |
TnReadLine
|
Receives data until an end of line (10 ASCII) |
TnReadMultiLine
|
Receives a full Tenet frame |
TnSend
|
Sends a 0-terminated string |
TnSendMultiLine
|
Sends a 0-terminated string. Handles end of line |
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 |
SmtpSendMessage
|
Sends a text string using the SMTP protocol. |