conexus logo

Conexus::IPv6::TCP Class Reference
[IPv6 EndpointsConexus I/O Endpoints]

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

#include <ipv6_tcp.h>

Inheritance diagram for Conexus::IPv6::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 size_t input_available () throw ()
int pending_output_size ()
 Returns the size in bytes of the local send queue.

Static Public Member Functions

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

Protected Member Functions

 TCP (uint32_t host, uint16_t port)
 TCP (const struct in6_addr &host=in6addr_any, uint16_t port=0)
 TCP (const std::string &host, uint16_t port)
 TCP (int 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 )
 Overloads the Socket ancestor send method to ensure that the socket is connected before trying to send.

Static Protected Member Functions

static TCP::pointer create (int 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::IPv6::TCP::pointer

Reimplemented from Conexus::IPv6::IP.

Reimplemented in Conexus::SSL::IPv6::TCP.

Examples:
ipv6_tcp_client.cpp, and ipv6_tcp_echo_client.cpp.


Constructor & Destructor Documentation

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

Conexus::IPv6::TCP::TCP ( const struct in6_addr &  host = in6addr_any,
uint16_t  port = 0 
) [protected]

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

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

Reimplemented in Conexus::SSL::IPv6::TCP.

Conexus::IPv6::TCP::TCP ( int  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::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::IPv6::TCP::CONEXUS_ENDPOINT_GENERIC_CREATE (  ) 

TCP::pointer Conexus::IPv6::TCP::create ( int  accepted_fd,
bool  b 
) [static, protected]

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

TCP::pointer Conexus::IPv6::TCP::create ( const struct in6_addr &  host,
uint16_t  port = 0 
) [static]

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

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

size_t Conexus::IPv6::TCP::input_available (  )  throw () [virtual]

Reimplemented from Conexus::Endpoint.

References Conexus::FileDescriptor::m_fd.

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

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

int Conexus::IPv6::TCP::pending_output_size (  ) 

Returns the size in bytes of the local send queue.

References Conexus::FileDescriptor::m_fd.

bool Conexus::IPv6::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::Socket::is_connected(), Conexus::FileDescriptor::m_fd, Conexus::READ, Conexus::READ_WRITE, and Conexus::WRITE.

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

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

Reimplemented from Conexus::Socket.

Reimplemented in Conexus::SSL::IPv6::TCP.

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


Friends And Related Function Documentation

friend class TCPServer [friend]

Reimplemented in Conexus::SSL::IPv6::TCP.


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

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