Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

tcpstream Class Reference

A more natural C++ "tcpstream" class for use by non-threaded applications. C++ "fstream" style tcpstream class. More...

#include <socket.h>

Inheritance diagram for tcpstream::

TCPStream Socket std::streambuf std::iostream List of all members.

Public Methods

 tcpstream ()
 Construct an unopened "tcpstream" object. More...

 tcpstream (const char *addr, int buffer=512)
 Construct and "open" (connect) the tcp stream to a remote socket. More...

 tcpstream (TCPSocket &tcp, int buffer=512)
 Construct and "accept" (connect) the tcp stream through a server. More...

void open (const char *addr, int buffer=512)
 Open a tcp stream connection. More...

void open (TCPSocket &tcp, int buffer=512)
 Open a tcp stream connection by accepting a tcp socket. More...

void close (void)
 Close the active tcp stream connection. More...

bool operator! () const
 Test to see if stream is open. More...


Detailed Description

A more natural C++ "tcpstream" class for use by non-threaded applications. C++ "fstream" style tcpstream class.

This class behaves a lot more like fstream and similar classes.

Author:
David Sugar <dyfet@ostel.com>


Constructor & Destructor Documentation

tcpstream::tcpstream  
 

Construct an unopened "tcpstream" object.

tcpstream::tcpstream const char *   addr,
int   buffer = 512
 

Construct and "open" (connect) the tcp stream to a remote socket.

Parameters:
addr   string address in form addr:port.
buffer   size for streaming (optional).

tcpstream::tcpstream TCPSocket &   tcp,
int   buffer = 512
 

Construct and "accept" (connect) the tcp stream through a server.

Parameters:
tcp   socket to accept from.
buffer   size for streaming (optional).


Member Function Documentation

void tcpstream::close void  
 

Close the active tcp stream connection.

void tcpstream::open TCPSocket &   tcp,
int   buffer = 512
 

Open a tcp stream connection by accepting a tcp socket.

Parameters:
tcp   socket to accept from.
buffer   size for streaming (optional)

void tcpstream::open const char *   addr,
int   buffer = 512
 

Open a tcp stream connection.

This will close the currently active connection first.

Parameters:
addr   string address in form addr:port.
buffer   size for streaming (optional)

bool tcpstream::operator! void   const
 

Test to see if stream is open.

Reimplemented from Socket.


The documentation for this class was generated from the following file:
Generated at Tue Nov 20 12:34:37 2001 for CommonC++ by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001