Conexus::NSPR::TCP Class Reference
[Classes for communicating via IP version 4 socketsClasses for communicating via IP version 4 socketsClasses for communicating via IP version 4 sockets]

#include <conexus/nspr_tcp.h>

Inheritance diagram for Conexus::NSPR::TCP:

Inheritance graph
[legend]
List of all members.

Detailed Description

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

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


Public Types

typedef ConexusPointer< TCPpointer
typedef ConexusPointer< TCPpointer
typedef ConexusPointer< TCPpointer

Public Member Functions

 IDIOSKOPOS_OBJECT (Conexus::NSPR::TCP)
void open () throw (open_exception)
virtual void connect () throw ( connect_exception )
virtual void connect (Address &a) throw ( connect_exception )
 TCP (uint16_t port=0)
void open () throw (open_exception)
virtual ssize_t write (const void *data, size_t size) throw ( write_exception )
 Overloads the Socket ancestor send method to ensure that the socket is connected before trying to send.
virtual Data::pointer read (size_t s=-1) throw ( read_exception )
 Receives a single datagram from the TCP socket up to s bytes in size; allocates any memory necessary as a smart pointer contained in the returned Data object.
virtual void connect () throw ( connect_exception )
virtual void connect (Address &a) throw ( connect_exception )
virtual const std::string & object_type ()
 TCP (uint16_t port=0)
void open () throw (open_exception)
virtual ssize_t write (const void *data, size_t size) throw ( write_exception )
 Overloads the Socket ancestor send method to ensure that the socket is connected before trying to send.
virtual Data::pointer read (size_t s=-1) throw ( read_exception )
 Receives a single datagram from the TCP socket up to s bytes in size; allocates any memory necessary as a smart pointer contained in the returned Data object.
virtual void connect () throw ( connect_exception )
virtual void connect (Address &a) throw ( connect_exception )
virtual const std::string & object_type ()

Static Public Member Functions

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

Protected Member Functions

 TCP (uint32_t interface, uint16_t port)
 TCP (const std::string &interface, uint16_t port)
 TCP (PRFileDesc *accepted_fd, bool)
 Protected constructor to be used by TCPServer to create TCP connections.
virtual ssize_t write_data (long int timeout, Data::const_pointer data) throw ( write_exception )
 Overloads the Socket ancestor send method to ensure that the socket is connected before trying to send.
virtual Data::pointer read_data (long int timeout, size_t s=0) throw ( read_exception )
 Receives a single datagram from the TCP socket up to s bytes in size; allocates any memory necessary as a smart pointer contained in the returned Data object.
 TCP (PRFileDesc *accepted_fd, bool)
 Protected constructor to be used by TCPServer to create TCP connections.
 TCP (PRFileDesc *accepted_fd, bool)
 Protected constructor to be used by TCPServer to create TCP connections.

Static Protected Member Functions

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

Friends

class TCPServer


Constructor & Destructor Documentation

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.

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.

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.


Member Function Documentation

Data::pointer Conexus::NSPR::TCP::read_data ( long int  timeout,
size_t  s = 0 
) throw ( read_exception ) [protected, virtual]

Receives a single datagram from the TCP socket up to s bytes in size; allocates any memory necessary as a smart pointer contained in the returned Data object.

If s = 0 then receives the next pending datagram, however large it may be.

Reimplemented from Conexus::NSPR::Socket.

virtual Data::pointer Conexus::NSPR::TCP::read ( size_t  s = -1  )  throw ( read_exception ) [virtual]

Receives a single datagram from the TCP socket up to s bytes in size; allocates any memory necessary as a smart pointer contained in the returned Data object.

If s < 0 then receives the next pending datagram, however large it may be.

Reimplemented from Conexus::Endpoint.

virtual Data::pointer Conexus::NSPR::TCP::read ( size_t  s = -1  )  throw ( read_exception ) [virtual]

Receives a single datagram from the TCP socket up to s bytes in size; allocates any memory necessary as a smart pointer contained in the returned Data object.

If s < 0 then receives the next pending datagram, however large it may be.

Reimplemented from Conexus::Endpoint.


The documentation for this class was generated from the following files:
Generated on Tue Mar 13 19:55:14 2007 by  doxygen 1.5.1