<HTML><HEAD>
<!-- This document was created with h2.pl -->
<TITLE>Tcp4u - Main Index</TITLE></HEAD>
<BODY BACKGROUND="" BGCOLOR="#FFFFC0" TEXT="#000000">
<H1>
Tcp4u - Main Index</H1>
<UL>
<LI><A HREF="#Mention1">TCP4U API - User Manual</A>
<LI><A HREF="#Mention2">License</A>
<LI><A HREF="#Mention3">Overview</A>
<LI><A HREF="#Mention4">What's new in version 3.31 ?</A>
<LI><A HREF="#Mention5">What's new in version 3.30 ?</A>
<LI><A HREF="#Mention6">Portability</A>
<LI><A HREF="#Mention7">Availability</A>
<LI><A HREF="#Mention8">Report Problem</A>
<LI><A HREF="#Mention9">Programming with the Tcp4u API</A>
<UL>
<LI><A HREF="#Mention10">The package</A>
<LI><A HREF="#Mention11">The types</A>
<LI><A HREF="#Mention12">The flow of functions</A>
</UL>
<LI><A HREF="#Mention13">The Tcp4u functions</A>
<UL>
<LI><A HREF="#Mention14">Multi-purpose functions</A>
<LI><A HREF="#Mention15">TCP related functions</A>
<LI><A HREF="#Mention16">Telnet Related functions</A>
<LI><A HREF="#Mention17">HTTP related functions</A>
<LI><A HREF="#Mention18">UDP related functions</A>
<LI><A HREF="#Mention19">SMTP related functions</A>
</UL>
</UL>
<hr size=4>
  <h1>
<A NAME="Mention1">TCP4U API - User Manual</A></h1>
   <h1>
<A NAME="Mention2">License</A></h1>
 <p><br>
<i>Tcp4u was written by Philippe Jounin and Laurent Le Bras and is Copyrighted 1996-1998 by them. </i><br>
<i>This library is free software; you can redistribute it and/or modify it under the terms the </i><u><A HREF="http://www.gnu.org/copyleft/lgpl.html">GNU Library General Public License</A></u><i> as published by the </i><u><A HREF="http://www.gnu.org/fsf/fsf.html">Free Software Foundation</A></u><i>; either version 2, or (at your option) any later version.</i><br>
<i>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.</i><br>
<i>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. </i></p>
 <HR><H1>
<A NAME="Mention3">Overview</A></h1>
 <p><br>
<i>Tcp4u  provides portable APIs which allow an easy use of the following IETF protocols :</i><br>
<UL><LI><i>The UDP protocol (</i><u><A HREF="ftp://ds.internic.net/rfc/rfc768.txt">RFC768</A></u><i>),</i><br>
<LI><i>The TCP protocol in connected mode,</i><br>
<LI><i>The Telnet protocol (</i><u><A HREF="ftp://ds.internic.net/rfc/rfc764.txt">RFC764</A></u><i>),</i><br>
<LI><i>The HTTP 1.0 protocol (</i><u><A HREF="ftp://ds.internic.net/rfc/rfc1945.txt">RFC1945</A></u><i>).</i><br>
<LI><i>The SMTP protocol such as described into the </i><u><A HREF="ftp://ds.internic.net/rfc/rfc821.txt">RFC821</A></u><br>
</UL><i><A HREF="tcp4u.htm#Mention10">The package</A> contains full source code (library and samples). The DLLs and some static libraries for Windows are provided already compiled.</i></p>
 <HR><H1>
<A NAME="Mention4">What's new in version 3.31 ?</A></h1>
 <p><br>
<UL><LI>Bug fixed into Tcp4uDump(). <br>
<LI>Add Udp2/ntp.c sample<br>
</UL> <HR><H1>
<A NAME="Mention5">What's new in version 3.30 ?</A></h1>
 <p><br>
<UL><LI>Bugs fixed into TnReadMultiLine(). Thanks Sergej Semenov!<br>
<LI>The <u><A HREF="tcp4u_p6.htmTCP4U API - User Manual">SMTP module</A></u>.<br>
<LI>The <u><A HREF="tcp4u_p3.htm#Mention2">TnProtoExchange</A></u> function.<br>
<LI>The <u><A HREF="tcp4u_p3.htm#Mention6">TnSendMultiLine</A></u> function.<br>
<LI>Tcp4u licensed under the <u><A HREF="http://www.gnu.org/copyleft/lgpl.html">GNU Library General Public License</A></u><i>.</i><br>
<LI>Ultrix is not supported anymore.<br>
<LI>AIX support<br>
</UL> <HR><H1>
<A NAME="Mention6">Portability</A></h1>
 <p><br>
The Tcp4u functions have been compiled and tested under the following operating system:<br>
<UL><LI><i>Windows 3.1 (Large Model)</i><br>
<LI><i>Windows for Workgroup (Large Model)</i><br>
<LI><i>Windows 95</i><br>
<LI><i>Windows NT</i><br>
<LI><i>Solaris (SunOS version 5)</i><br>
<LI><i>Sun OS version 4</i><br>
<LI><i>HP-UX</i><br>
<LI><i>Dec OSF1</i><br>
<LI><i>AIX</i><br>
<LI><i>Linux</i><br>
</UL> <HR><H1>
<A NAME="Mention7">Availability</A></h1>
 <p><br>
Tcp4u is available at the following sites :<br>
<UL><LI><u><A HREF="ftp://papa.indstate.edu/winsock-l/WindowsNT/Develop">ftp://papa.indstate.edu/winsock-l/WindowsNT/Develop</A></u> and its mirrors<br>
<LI><u><A HREF="http://download.com">http://download.com</A></u><br>
<LI><u><A HREF="http://www.hotfiles.com">http://www.hotfiles.com</A></u><br>
</UL>Updates, add-ons and development news are available from my home page :<br>
<UL><LI><u><A HREF="http://www.magic.fr/~jounin-ph">http://www.magic.fr/~jounin-ph</A></u><br>
</UL> <HR><H1>
<A NAME="Mention8">Report Problem</A></h1>
 <p><br>
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 <u><A HREF="mailto:ph.jounin@computer.org">Philippe Jounin</A></u>.<br>
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.</p>
 <HR><H1>
<A NAME="Mention9">Programming with the Tcp4u API</A></h1>
   <h2>
<A NAME="Mention10">The package</A></h2>
 <p><br>
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 :<br>
<UL><LI>This reference<br>
<LI>The library libtcp4ux.a<br>
<LI>The C-header files tcp4u.h, udp4u.h and http4u.h<br>
</UL>If you intend to use Tcp4u under Windows; the DLLs and static library for MSVC are provided. The following files are necessary :<br>
<UL><LI>This reference<br>
<LI>The DLL tcp4w.dll or tcp4w32.dll<br>
<LI>The requested header files (depends on your language).<br>
</UL> <h2>
<A NAME="Mention11">The types</A></h2>
 <p><br>
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:<br>
</p>
<TABLE><TR align="left">
<TD colspan=1 align="left">SOCKET <BR></TD>
<TD colspan=1 align="left">a 16 bit-unsigned integer  <BR></TD></TR><TR align="left">
<TD colspan=1 align="left">LPSTR <BR></TD>
<TD colspan=1 align="left">a pointer to a variable memory location  <BR></TD></TR><TR align="left">
<TD colspan=1 align="left">LPCSTR <BR></TD>
<TD colspan=1 align="left">a pointer to a non-writeable memory location  <BR></TD></TR><TR align="left">
<TD colspan=1 align="left">far <BR></TD>
<TD colspan=1 align="left">This attribute is only meaningful for Windows 3.1.   <BR></TD></TR></TABLE>
 <h2>
<A NAME="Mention12">The flow of functions</A></h2>
 <p><br>
The first function that an application should call is <b><A HREF="tcp4u_p1.htm#Mention2">Tcp4uInit</A></b>. It allocates buffers and get some information about the task which has called it. The task is ready to open connections. <br>
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.<br>
Before quitting, the application must close opened sockets with TcpClose, and call <b><A HREF="tcp4u_p1.htm#Mention1">Tcp4uCleanup</A></b>.</p>
 <HR><H1>
<A NAME="Mention13">The Tcp4u functions</A></h1>
 <p><br>
This table lists alphabetically all the functions implemented in this version. The remainder <br>
of the documentation describes them one by one. </p>
 <h2>
<A NAME="Mention14">Multi-purpose functions</A></h2>
 <p><br>
</p>
<TABLE><TR align="left">
<TD colspan=1 align="left"><b><A HREF="tcp4u_p1.htm#Mention1">Tcp4uCleanup</A></b>
<BR></TD>
<TD colspan=1 align="left">Last function to be called, frees local resources   <BR></TD></TR><TR align="left">
<TD colspan=1 align="left"><b><A HREF="tcp4u_p1.htm#Mention5">Tcp4uEnableLog</A></b>
<BR></TD>
<TD colspan=1 align="left">Allows tracing of received/sent frames and functions  <BR></TD></TR><TR align="left">
<TD colspan=1 align="left"><b><A HREF="tcp4u_p1.htm#Mention2">Tcp4uInit</A> </b>
<BR></TD>
<TD colspan=1 align="left">First function to be called   <BR></TD></TR><TR align="left">
<TD colspan=1 align="left"><b><A HREF="tcp4u_p1.htm#Mention3">Tcp4uVer</A> </b>
<BR></TD>
<TD colspan=1 align="left">Gives the 2-part version of the library (packed into an int).   <BR></TD></TR><TR align="left">
<TD colspan=1 align="left"><b><A HREF="tcp4u_p1.htm#Mention4">TcpGetLocalID</A> </b>
<BR></TD>
<TD colspan=1 align="left">Returns name and address of the local host   <BR></TD></TR></TABLE>
 <h2>
<A NAME="Mention15">TCP related functions</A></h2>
 <p><br>
</p>
<TABLE><TR align="left">
<TD colspan=1 align="left"><b><A HREF="tcp4u_p2.htm#Mention1">Tcp4uErrorString</A> </b>
<BR></TD>
<TD colspan=1 align="left">Returns error string about an error code   <BR></TD></TR><TR align="left">
<TD colspan=1 align="left"><b><A HREF="tcp4u_p2.htm#Mention2">TcpAbort</A> </b>
<BR></TD>
<TD colspan=1 align="left">Aborts the current blocking call   <BR></TD></TR><TR align="left">
<TD colspan=1 align="left"><b><A HREF="tcp4u_p2.htm#Mention3">TcpAccept</A> </b>
<BR></TD>
<TD colspan=1 align="left">Waits for a incoming connection   <BR></TD></TR><TR align="left">
<TD colspan=1 align="left"><b><A HREF="tcp4u_p2.htm#Mention4">TcpClose</A> </b>
<BR></TD>
<TD colspan=1 align="left">Closes a socket   <BR></TD></TR><TR align="left">
<TD colspan=1 align="left"><b><A HREF="tcp4u_p2.htm#Mention5">TcpConnect</A> </b>
<BR></TD>
<TD colspan=1 align="left">Establishes a connection to a peer   <BR></TD></TR><TR align="left">
<TD colspan=1 align="left"><b><A HREF="tcp4u_p2.htm#Mention6">TcpFlush</A> </b>
<BR></TD>
<TD colspan=1 align="left">Flushes the buffer associated with a socket   <BR></TD></TR><TR align="left">
<TD colspan=1 align="left"><b><A HREF="tcp4u_p2.htm#Mention7">TcpGetListenSocket</A> </b>
<BR></TD>
<TD colspan=1 align="left">Creates a socket and listen for incoming connection   <BR></TD></TR><TR align="left">
<TD colspan=1 align="left"><b><A HREF="tcp4u_p2.htm#Mention8">TcpGetRemoteID</A> </b>
<BR></TD>
<TD colspan=1 align="left">Returns name and address of the connected host   <BR></TD></TR><TR align="left">
<TD colspan=1 align="left"><b><A HREF="tcp4u_p2.htm#Mention9">TcpIsDataAvail</A></b>
<BR></TD>
<TD colspan=1 align="left">Returns TRUE if unread data are available   <BR></TD></TR><TR align="left">
<TD colspan=1 align="left"><b><A HREF="tcp4u_p2.htm#Mention9">TcpIsOOBDataAvail</A> </b>
<BR></TD>
<TD colspan=1 align="left">Returns TRUE if unread Out of Band data are available   <BR></TD></TR><TR align="left">
<TD colspan=1 align="left"><b><A HREF="tcp4u_p2.htm#Mention10">TcpPPRecv</A> </b>
<BR></TD>
<TD colspan=1 align="left">Receives data with length of frame in the two first bytes   <BR></TD></TR><TR align="left">
<TD colspan=1 align="left"><b><A HREF="tcp4u_p2.htm#Mention11">TcpPPSend</A> </b>
<BR></TD>
<TD colspan=1 align="left">Sends data, the two first bytes of the frame are its length   <BR></TD></TR><TR align="left">
<TD colspan=1 align="left"><b><A HREF="tcp4u_p2.htm#Mention12">TcpRecv</A> </b>
<BR></TD>
<TD colspan=1 align="left">Receives data   <BR></TD></TR><TR align="left">
<TD colspan=1 align="left"><b><A HREF="tcp4u_p2.htm#Mention13">TcpRecvUntilStr</A> </b>
<BR></TD>
<TD colspan=1 align="left">Receives data until a given character/string   <BR></TD></TR><TR align="left">
<TD colspan=1 align="left"><b><A HREF="tcp4u_p2.htm#Mention14">TcpSend</A> </b>
<BR></TD>
<TD colspan=1 align="left">Sends data to connected host   <BR></TD></TR></TABLE>
 <h2>
<A NAME="Mention16">Telnet Related functions</A></h2>
 <p><br>
</p>
<TABLE><TR align="left">
<TD colspan=1 align="left"><b><A HREF="tcp4u_p3.htm#Mention1">TnGetAnswerCode</A> </b>
<BR></TD>
<TD colspan=1 align="left">Receives data until end of a Telnet frame   <BR></TD></TR><TR align="left">
<TD colspan=1 align="left"><b><A HREF="tcp4u_p3.htm#Mention2">TnProtoExchange</A></b>
<BR></TD>
<TD colspan=1 align="left">Completes a full telnet dialog  <BR></TD></TR><TR align="left">
<TD colspan=1 align="left"><b><A HREF="tcp4u_p3.htm#Mention3">TnReadLine</A> </b>
<BR></TD>
<TD colspan=1 align="left">Receives data until an end of line (10 ASCII)  <BR></TD></TR><TR align="left">
<TD colspan=1 align="left"><b><A HREF="tcp4u_p3.htm#Mention4">TnReadMultiLine</A> </b>
<BR></TD>
<TD colspan=1 align="left">Receives a full Tenet frame  <BR></TD></TR><TR align="left">
<TD colspan=1 align="left"><b><A HREF="tcp4u_p3.htm#Mention5">TnSend</A> </b>
<BR></TD>
<TD colspan=1 align="left">Sends a 0-terminated string   <BR></TD></TR><TR align="left">
<TD colspan=1 align="left"><b><A HREF="tcp4u_p3.htm#Mention6">TnSendMultiLine</A> </b>
<BR></TD>
<TD colspan=1 align="left">Sends a 0-terminated string. Handles end of line  <BR></TD></TR></TABLE>
 <h2>
<A NAME="Mention17">HTTP related functions</A></h2>
 <p><br>
</p>
<TABLE><TR align="left">
<TD colspan=1 align="left"><b><A HREF="tcp4u_p4.htm#Mention1">Http4uErrorString</A></b>
<BR></TD>
<TD colspan=1 align="left">Returns an error string about a HTTP return code  <BR></TD></TR><TR align="left">
<TD colspan=1 align="left"><b><A HREF="tcp4u_p4.htm#Mention2">Http4uSetBufferSize</A></b>
<BR></TD>
<TD colspan=1 align="left">Changes the internal buffer size  <BR></TD></TR><TR align="left">
<TD colspan=1 align="left"><b><A HREF="tcp4u_p4.htm#Mention3">Http4uSetTimeout</A></b>
<BR></TD>
<TD colspan=1 align="left">Changes the internal timeout  <BR></TD></TR><TR align="left">
<TD colspan=1 align="left"><b><A HREF="tcp4u_p4.htm#Mention4">HttpGetFile</A></b>
<BR></TD>
<TD colspan=1 align="left">Retrieves a file using the HTTP protocol  <BR></TD></TR><TR align="left">
<TD colspan=1 align="left"><b><A HREF="tcp4u_p4.htm#Mention5">HttpGetFileEx</A></b>
<BR></TD>
<TD colspan=1 align="left">Retrieves both files and headers using the HTTP protocol  <BR></TD></TR></TABLE>
 <h2>
<A NAME="Mention18">UDP related functions</A></h2>
 <p><br>
</p>
<TABLE><TR align="left">
<TD colspan=1 align="left"><b><A HREF="tcp4u_p5.htm#Mention1">Udp4uServiceToPort</A></b>
<BR></TD>
<TD colspan=1 align="left">Translates a service into a port identifier  <BR></TD></TR><TR align="left">
<TD colspan=1 align="left"><b><A HREF="tcp4u_p5.htm#Mention2">UdpBind</A></b>
<BR></TD>
<TD colspan=1 align="left">Forces a socket to communicate only with a given host  <BR></TD></TR><TR align="left">
<TD colspan=1 align="left"><b><A HREF="tcp4u_p5.htm#Mention3">UdpCleanup</A></b>
<BR></TD>
<TD colspan=1 align="left">Destroys the local UDP socket  <BR></TD></TR><TR align="left">
<TD colspan=1 align="left"><b><A HREF="tcp4u_p5.htm#Mention4">UdpInit</A></b>
<BR></TD>
<TD colspan=1 align="left">Creates a local UDP socket  <BR></TD></TR><TR align="left">
<TD colspan=1 align="left"><b><A HREF="tcp4u_p5.htm#Mention6">UdpSend</A></b>
<BR></TD>
<TD colspan=1 align="left">sends a datagram to a previously given host  <BR></TD></TR><TR align="left">
<TD colspan=1 align="left"><b><A HREF="tcp4u_p5.htm#Mention5">UdpRecv</A></b>
<BR></TD>
<TD colspan=1 align="left">Receives or wait for a datagram  <BR></TD></TR></TABLE>
 <h2>
<A NAME="Mention19">SMTP related functions</A></h2>
 <p><br>
</p>
<TABLE><TR align="left">
<TD colspan=1 align="left"><b><A HREF="tcp4u_p6.htm#Mention1">SmtpSendMessage</A></b>
<BR></TD>
<TD colspan=1 align="left">Sends a text string using the SMTP protocol.  <BR></TD></TR><TR align="left">
<TD colspan=1 align="left"><BR></TD>
<TD colspan=1 align="left"><BR></TD></TR></TABLE>
</body></html>
<hr size=4>
<table border=1 CELLPADDING=7 align=center><tr>
<td><A HREF="tcp4u.htm">Overview</A></td>
<td><A HREF="tcp4u_p1.htm">Multi purpose func.</A></td>
<td><A HREF="tcp4u_p2.htm">TCP functions</A></td>
<td><A HREF="tcp4u_p3.htm">Telnet related func</A></td>
<td><A HREF="tcp4u_p4.htm">HTTP functions</A></td>
<td><A HREF="tcp4u_p5.htm">UDP functions</A></td>
<td><A HREF="tcp4u_p6.htm">SMTP functions</A></td>
</tr></table>
<font italic size=2>
<table border=0><tr>
<td align=left>Tcp4u version 3.31 by Ph. Jounin and Laurent Le Bras</td>
<td align=right>Last updated: 10th march 1998</td>
<tr>
</table>
</font>


syntax highlighted by Code2HTML, v. 0.9.1