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

#include <conexus/ipv4_tcp.h>

Inheritance diagram for Conexus::IPv4::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 boost::shared_ptr<
TCP
pointer

Public Member Functions

 TCP (uint16_t port=0)
int pending_input_size ()
 Returns the size in bytes of the next pending datagram, or 0 when no datagram is pending.
int pending_output_size ()
 Returns the size in bytes of the local send queue.
virtual ssize_t write (const void *data, size_t size) throw (write_error)
 Overloads the Socket ancestor send method to ensure that the socket is connected before trying to send.
virtual Data read (size_t s=-1) throw (read_error)
 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_error)
virtual void connect (Address &a) throw (connect_error)
virtual const std::string & object_type ()

Static Public Member Functions

static TCP::pointer create (uint16_t port=0)

Protected Member Functions

 TCP (int accepted_fd, bool)
 Protected constructor to be used by TCPServer to create TCP connections.
virtual void on_local_interface_changed (unsigned which)
virtual void on_remote_address_changed (unsigned which)

Static Protected Member Functions

static TCP::pointer create (int accepted_fd, bool)

Friends

class TCPServer


Constructor & Destructor Documentation

Conexus::IPv4::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.


Member Function Documentation

Data Conexus::IPv4::TCP::read size_t  s = -1  )  throw (read_error) [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::Socket.


The documentation for this class was generated from the following files:
Generated on Sun Aug 6 12:17:14 2006 by  doxygen 1.4.6