Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

TCPStream Class Reference

#include <TcpStream.hpp>

List of all members.

Public Methods

 TCPStream ()
 TCPStream (Socket &server)
 ~TCPStream ()
void accept (Socket &server)
void write (char *data, int size)
void write (string &data)
string read ()
string read (int size)
bool isPending (unsigned long timeout)

Detailed Description

Represents a client socket.

Constructor & Destructor Documentation


Default constructor. Don't open any connection.

TCPStream::TCPStream Socket   server

Construtor. Accept a connection from the specified server socket.


Destructor. Close the connection.

Member Function Documentation

void TCPStream::accept Socket   server

Accept a connection from the server socket.

bool TCPStream::isPending unsigned long    timeout

Check if any data is waiting.

True if there is data pooled.
timeout  Milliseconds to block. -1 for infinite timeout.

string TCPStream::read int    size

Recieve data.

This is a blocking call.
size  Get that many bytes of data.

string TCPStream::read  

Recieve all awaiting data.

This is a blocking call.

void TCPStream::write string &    data

Write data to the connected client.

void TCPStream::write char *    data,
int    size

Write data to the connected client.

The documentation for this class was generated from the following files:
Generated on Sun Jan 20 21:00:00 2002 for bkmd by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001