#include <Comm.h>
Inheritance diagram for TCPReceiver:
Public Member Functions | |
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 &) |
this receiver uses a TCP port to receive packets. It creates a local TCP port at creation time. Then, it receives packets by accepting new connections, reading one packet from each connection, and closing connections immediately after reading one packet.
TCPReceiver::TCPReceiver | ( | in_port_t | port, | |
const char * | hostname = NULL , |
|||
bool | reuse = true , |
|||
int | maxconn = -1 | |||
) |
constructs a TCPReceiver
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 |
virtual size_t TCPReceiver::receive | ( | char * | , | |
size_t | ||||
) | throw (CommException) [virtual] |
virtual void TCPReceiver::shutdown | ( | ) | [virtual] |
closes this sender
Reimplemented from Receiver.
virtual 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.
Implements Receiver.
virtual 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.
Implements Receiver.