Siena C++ API Documentation
Author: Antonio Carzaniga

Siena C++ API documentation (v. 0.4.3)

- Main Page
- Classes
- Files
- Examples

- Class List
- Class Hierarchy
- Class Members

# TCPReceiver Class Reference

`#include <Comm.h>`

Inheritance diagram for TCPReceiver:

List of all members.

## 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 &)

## Detailed Description

TCP-based receiver

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.

Examples:

  subscriber.cc.

## 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

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

receives a message

Exceptions:

  | CommException |

Implements Receiver.

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.

The documentation for this class was generated from the following file:

- Comm.h

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