Siena C++ API documentation (v. 0.4.1)

Main Page   Class Hierarchy   Compound List   File List   Compound Members   Examples  

TCPReceiver Class Reference

#include <Comm.h>

Inheritance diagram for TCPReceiver::

Receiver List of all members.

Public Methods

 TCPReceiver (in_port_t port, const char *hostname=NULL, bool reuse=true, int maxconn=-1)
virtual size_t receive (char *, size_t) throw (CommException)
virtual void shutdown ()
virtual string uri ()
virtual string& uri (string &)

Detailed Description

TCP-based receiver

this receiver uses a TCP port to receive packets. It creates a local TCP port when initialize. Then, in order to receive a packet, it accepts a new connection from its TCP port, reads a packet from the connection, and closes the connection.


Constructor & Destructor Documentation

TCPReceiver::TCPReceiver ( in_port_t port,
const char * hostname = NULL,
bool reuse = true,
int maxconn = -1 )
 

constructs a TCPReceiver

Parameters:
port   port number
hostname   externally visible name for this host. Although it is possible for this library to figure out a hostname, the default value is not 100% reliable, especially in cases in which the host uses dynamically-assigned IP addresses, or in the presence of several network interfaces.
reuse   determines whether the given port number should be immediately re-used, if recently bound to another application.
maxconn   sets the length of the OS-level queue for incoming connections


Member Function Documentation

size_t TCPReceiver::receive ( char *,
size_t ) throw (CommException) [virtual]
 

receives a message

Exceptions:
CommException  

Reimplemented from Receiver.

void TCPReceiver::shutdown ( ) [virtual]
 

closes this sender

Reimplemented from Receiver.

string & TCPReceiver::uri ( string & ) [virtual]
 

exernally visible URI for this receiver

a URI is an external representation of the point of contact of this receiver. This URI can be used to create senders to contact this receiver.

Reimplemented from Receiver.

string TCPReceiver::uri ( ) [virtual]
 

URI for this receiver

a URI is an external representation of the point of contact of this receiver. This URI can be used to create senders to contact this receiver.

Reimplemented from Receiver.


The documentation for this class was generated from the following file:
Copyright © 2001 University of Colorado.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". This documentation is authored and maintained by Antonio Carzaniga