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

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 List of all members.

Public Member Functions

 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>
Examples:

tcp.cpp, and tcpstr1.cpp.


Constructor & Destructor Documentation

tcpstream::tcpstream const tcpstream rhs  )  [inline]
 

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.

Examples:
tcp.cpp.

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)
Examples:
tcp.cpp.

bool tcpstream::operator!  )  const
 

Test to see if stream is open.

Reimplemented from Socket.


The documentation for this class was generated from the following file:
Generated on Tue Jan 18 14:32:38 2005 for GNU CommonC++ by  doxygen 1.3.9.1