Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Examples  

ost::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 ost::tcpstream:

ost::TCPStream ost::Socket List of all members.

Public Methods

 tcpstream (const tcpstream &rhs)
 tcpstream ()
 Construct an unopened "tcpstream" object.

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

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

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

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

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

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


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

ost::tcpstream::tcpstream const tcpstream &    rhs [inline]
 

ost::tcpstream::tcpstream  
 

Construct an unopened "tcpstream" object.

ost::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).

ost::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 ost::tcpstream::close void   
 

Close the active tcp stream connection.

void ost::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 ost::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 ost::tcpstream::operator!  
 

Test to see if stream is open.

Reimplemented from ost::Socket.


The documentation for this class was generated from the following file:
Generated on Thu Nov 21 12:28:32 2002 for GNU CommonC++ by doxygen1.2.18