conexus logo

Conexus::NSPR::TCP Class Reference
[Conexus I/O Endpoints with NSPR supportConexus I/O Endpoints]

This class encapsulates a socket used for TCP/IP communications. More...

#include <tcp.h>

Inheritance diagram for Conexus::NSPR::TCP:

Inheritance graph
[legend]

List of all members.

Public Types

typedef ConexusPointer< TCPpointer

Public Member Functions

 CONEXUS_ENDPOINT_GENERIC_CREATE ()
virtual ~TCP () throw ()
virtual bool shutdown (ReadWrite read_write=READ_WRITE)
 Shut down the entirety or part of a TCP connection.
virtual void open () throw (open_exception)
virtual void connect () throw ( connect_exception )
virtual void connect (Address &a) throw ( connect_exception )

Static Public Member Functions

static pointer create (uint16_t port=0)
static pointer create (uint32_t host, uint16_t port)
static pointer create (const std::string &host, uint16_t port)

Protected Member Functions

 TCP (uint32_t host, uint16_t port)
 TCP (const std::string &host, uint16_t port)
 TCP (PRFileDesc *accepted_fd, bool)
 Protected constructor to be used by TCPServer to create TCP connections.
virtual void on_local_address_changed ()
virtual void on_remote_address_changed ()
virtual size_t write_data (const Data data, Timeout timeout) throw ( write_exception )
 Reimplements the Socket ancestor write_data method to ensure that the socket is connected before trying to send.

Static Protected Member Functions

static TCP::pointer create (PRFileDesc *accepted_fd, bool)

Friends

class TCPServer


Detailed Description

This class encapsulates a socket used for TCP/IP communications.

Author:
Rick L Vinyard Jr <rvinyard@cs.nmsu.edu>

Member Typedef Documentation

typedef ConexusPointer<TCP> Conexus::NSPR::TCP::pointer

Reimplemented from Conexus::NSPR::Socket.


Constructor & Destructor Documentation

Conexus::NSPR::TCP::TCP ( uint32_t  host,
uint16_t  port 
) [protected]

Conexus::NSPR::TCP::TCP ( const std::string &  host,
uint16_t  port 
) [protected]

Conexus::NSPR::TCP::~TCP (  )  throw () [virtual]

Conexus::NSPR::TCP::TCP ( PRFileDesc *  accepted_fd,
bool   
) [protected]

Protected constructor to be used by TCPServer to create TCP connections.

The second bool parameter is used to differentiate the public method from the private method.

References Conexus::NSPR::FileDescriptor::m_fd, Conexus::Endpoint::m_state, Conexus::Endpoint::set_state_opened(), Conexus::SOCKET_ACCEPTED, Conexus::SOCKET_BOUND, and Conexus::SOCKET_CONNECTED.


Member Function Documentation

Conexus::NSPR::TCP::CONEXUS_ENDPOINT_GENERIC_CREATE (  ) 

void Conexus::NSPR::TCP::connect ( Address a  )  throw ( connect_exception ) [virtual]

void Conexus::NSPR::TCP::connect (  )  throw ( connect_exception ) [virtual]

TCP::pointer Conexus::NSPR::TCP::create ( PRFileDesc *  accepted_fd,
bool  b 
) [static, protected]

References TCP().

TCP::pointer Conexus::NSPR::TCP::create ( const std::string &  host,
uint16_t  port 
) [static]

References TCP().

TCP::pointer Conexus::NSPR::TCP::create ( uint32_t  host,
uint16_t  port 
) [static]

References TCP().

TCP::pointer Conexus::NSPR::TCP::create ( uint16_t  port = 0  )  [static]

References TCP().

void Conexus::NSPR::TCP::on_local_address_changed (  )  [protected, virtual]

void Conexus::NSPR::TCP::on_remote_address_changed (  )  [protected, virtual]

void Conexus::NSPR::TCP::open (  )  throw (open_exception) [virtual]

bool Conexus::NSPR::TCP::shutdown ( ReadWrite  read_write = READ_WRITE  )  [virtual]

Shut down the entirety or part of a TCP connection.

Parameters:
read_write use enum ReadWrite values to indicate which portion of the TCP connection (READ, WRITE or READWRITE) should be shut down
Returns:
true if the requested portion of the TCP connection was shut down

References Conexus::NSPR::Socket::is_connected(), Conexus::NSPR::FileDescriptor::m_fd, Conexus::READ, Conexus::READ_WRITE, and Conexus::WRITE.

size_t Conexus::NSPR::TCP::write_data ( const Data  data,
Timeout  timeout 
) throw ( write_exception ) [protected, virtual]

Reimplements the Socket ancestor write_data method to ensure that the socket is connected before trying to send.

Reimplemented from Conexus::NSPR::Socket.

References Conexus::SOCKET_CONNECTED, and Conexus::NSPR::Socket::write_data().


Friends And Related Function Documentation

friend class TCPServer [friend]


The documentation for this class was generated from the following files:

Generated on Wed Jul 8 15:51:29 2009 for conexus by doxygen 1.5.8