ticc_fdstream - Implementation of iostreams tied to File Descriptors
Short description. Needs work...
The main functions are:
fdostream( int fd );
Open an ouput stream connected to the socket with the id: fd
fdistream( int fd );
Open an input stream connected to the socket with the id: fd
Both fdostream and fdistream can be used as normal ostream and istream streams for output/input respectively.
bool nb_getline( istream& stream, string& s, int& timeout );
bool nb_putline( ostream& stream, const string& s, int& timeout );
read/write a string s from/to a non-blocking stream stream using timeout to terminate the operation when it fails to complete within timeout
This only works for streams connected to a socket for which the operation mode is set to non_blocking, using fcntl( sock, F_SETFL, O_NONBLOCK ) or the like.
Ko van der Sloot [email protected]