![]() |
TCP support library |
Introduction Screenshots Mailing Lists and IRC Alternative Browsers Special Thanks
FAQ
Download binaries Platforms Compiling Mnemonic Other useful software
Core Message modules Library modules Object modules Coding Guidelines Browse Source Using CVS
Website questions to: |
The lib-tcpconnection module contains a library for multi-threaded access to network services based on TCP/IP. It supports proxies as well as secure sockets (using the SSLeay library). TODO: This library is a bit outdated as it is not really C++ (uses return values in some places instead of exceptions, does still use plain C buffers etc.).
Using lib-tcpconnection is very straightforward. You initialise a Before connecting, you need to make it lookup the hostname. If that is successful, connect to the host:tcp_connection myconn("localhost",8000); Reading data from the connection is now simply a matter of calling theif(myconn.lookup()!=0) return false; if(myconn.connect()!=0) return false; read
member with a pointer to a buffer.
Similarly, usechar buffer[1024]; while(myconn.read(buffer,1024)>0) { // use data } write to write something to the connection.
The connection is closed automatically upon destruction.
If you initialise the connection object with a second host/port pair,
these will be used to connect to a proxy instead. Use the
For proxy support according to SOCKS version 5 as specified in rfc1928.txt we will probably use the reference implementation from NEC. Although the minimalistic forward option seems ok for the time being. We do not yet support automatic proxy configuration along the lines of Netscape's x-ns-proxy-autoconfig format.
If you have SSLeay
installed, or if you have pointed autoconf at the SSLeay directory
using The SSLeay library is available at ftp://ftp.psy.uq.oz.au/pub/Crypto/SSL/More information can be obtained from the SSLeay FAQ. There is also some documentation written by Eric Young. |