xorp

IoTcpUdpReceiver Class Reference

A base class for I/O TCP/UDP data receiver. More...

#include <io_tcpudp.hh>

Inheritance diagram for IoTcpUdpReceiver:
IoTcpUdpComm

List of all members.

Public Member Functions

 IoTcpUdpReceiver ()
 Default constructor.
virtual ~IoTcpUdpReceiver ()
 Virtual destructor.
virtual void recv_event (const string &if_name, const string &vif_name, const IPvX &src_host, uint16_t src_port, const vector< uint8_t > &data)=0
 Data received event.
virtual void inbound_connect_event (const IPvX &src_host, uint16_t src_port, IoTcpUdp *Xnew_io_tcpudp)=0
 Inbound connection request received event.
virtual void outgoing_connect_event ()=0
 Outgoing connection request completed event.
virtual void error_event (const string &error, bool fatal)=0
 Error occured event.
virtual void disconnect_event ()=0
 Connection closed by peer event.

Detailed Description

A base class for I/O TCP/UDP data receiver.

The real receiver must inherit from this class and register with the corresponding IoTcpUdp entity to receive the TCP/UDP data and data-related events.

See also:
IoTcpUdp.

Member Function Documentation

virtual void IoTcpUdpReceiver::disconnect_event ( ) [pure virtual]

Connection closed by peer event.

It applies only to TCP sockets. This method is not called if the socket is gracefully closed through close().

Implemented in IoTcpUdpComm.

virtual void IoTcpUdpReceiver::error_event ( const string &  error,
bool  fatal 
) [pure virtual]

Error occured event.

Parameters:
errora textual description of the error.
fatalindication of whether socket is shutdown because of error.

Implemented in IoTcpUdpComm.

virtual void IoTcpUdpReceiver::inbound_connect_event ( const IPvX src_host,
uint16_t  src_port,
IoTcpUdp Xnew_io_tcpudp 
) [pure virtual]

Inbound connection request received event.

It applies only to TCP sockets.

Parameters:
src_hostthe originating host IP address.
src_portthe originating host port number.
new_io_tcpudpthe handler for the new connection.

Implemented in IoTcpUdpComm.

virtual void IoTcpUdpReceiver::outgoing_connect_event ( ) [pure virtual]

Outgoing connection request completed event.

It applies only to TCP sockets.

Implemented in IoTcpUdpComm.

virtual void IoTcpUdpReceiver::recv_event ( const string &  if_name,
const string &  vif_name,
const IPvX src_host,
uint16_t  src_port,
const vector< uint8_t > &  data 
) [pure virtual]

Data received event.

Parameters:
if_namethe interface name the packet arrived on, if known. If unknown, then it is an empty string.
vif_namethe vif name the packet arrived on, if known. If unknown, then it is an empty string.
src_hostthe originating host IP address.
src_portthe originating host port number.
datathe data received.

Implemented in IoTcpUdpComm.


The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Enumerations