fipa_services
Public Member Functions | Static Protected Member Functions | Friends | List of all members
fipa::services::transports::tcp::TCPTransport Class Reference

#include <TCPTransport.hpp>

Inheritance diagram for fipa::services::transports::tcp::TCPTransport:
fipa::services::transports::Transport

Public Member Functions

 TCPTransport ()
 
 ~TCPTransport ()
 
virtual void start ()
 
void listen (uint16_t port=0)
 
void update (bool readAllMessages)
 
Address getAddress (const std::string &interfaceName="eth0") const
 
virtual OutgoingConnection::Ptr establishOutgoingConnection (const Address &address)
 
- Public Member Functions inherited from fipa::services::transports::Transport
virtual ~Transport ()
 
void registerObserver (TransportObserver observer)
 
Type getType () const
 
std::string getName () const
 
void send (const std::string &receiverName, const Address &address, const std::string &data)
 
std::set< AddressgetAddresses () const
 
OutgoingConnection::Ptr getCachedOutgoingConnection (const std::string &receiverName, const Address &address)
 
void cleanup (const std::string &receiver)
 
void notify (const std::string &message)
 
void setConfiguration (const Configuration &configuration)
 
const ConfigurationgetConfiguration () const
 

Static Protected Member Functions

static boost::asio::io_service & getIOService ()
 

Friends

class OutgoingConnection
 

Additional Inherited Members

- Public Types inherited from fipa::services::transports::Transport
enum  Type { UNKNOWN = 0x00, UDT = 0x01, TCP = 0x02, ALL = 0xFF }
 Builtin transport types that can be activated. More...
 
typedef boost::shared_ptr< TransportPtr
 
- Static Public Member Functions inherited from fipa::services::transports::Transport
static Transport::Ptr create (Type type)
 
static Type getTypeFromTxt (const std::string &typeTxt)
 
static std::string getLocalIPv4Address (const std::string &interfaceName="eth0")
 
- Static Public Attributes inherited from fipa::services::transports::Transport
static std::map< Type, std::string > TypeTxt
 
- Protected Member Functions inherited from fipa::services::transports::Transport
 Transport (Type type)
 
 Transport (const Configuration &configuration)
 
- Protected Attributes inherited from fipa::services::transports::Transport
Configuration mConfiguration
 

Detailed Description

This transport implementation receives messages on a socket and forwards them to ROCK agents. Everything is static.

Constructor & Destructor Documentation

fipa::services::transports::tcp::TCPTransport::TCPTransport ( )

Default constructor for TCPTransport

fipa::services::transports::tcp::TCPTransport::~TCPTransport ( )

Member Function Documentation

OutgoingConnection::Ptr fipa::services::transports::tcp::TCPTransport::establishOutgoingConnection ( const Address address)
virtual

Establish outgoing connection using TCPTransport

Returns
OutgoingConnection to the given address

Reimplemented from fipa::services::transports::Transport.

Address fipa::services::transports::tcp::TCPTransport::getAddress ( const std::string &  interfaceName = "eth0") const
virtual

Gets the address it is being listened on.

Returns
Address for TCPTransport

Reimplemented from fipa::services::transports::Transport.

boost::asio::io_service & fipa::services::transports::tcp::TCPTransport::getIOService ( )
staticprotected

Gets the io_service object used for all operations.

void fipa::services::transports::tcp::TCPTransport::listen ( uint16_t  port = 0)

Starts to listen for new tcp connections on a given port. This is done in a new thread.

void fipa::services::transports::tcp::TCPTransport::start ( )
virtual

Start the transport using on a given port Note that setting maxClients has no effect for this transport.

Reimplemented from fipa::services::transports::Transport.

void fipa::services::transports::tcp::TCPTransport::update ( bool  readAllMessages)
virtual

Update client connection by reading sockets

Parameters
readAllMessagesif set to true, try reading all connections otherwise only one (might lead to starvation)

Reimplemented from fipa::services::transports::Transport.

Friends And Related Function Documentation

friend class OutgoingConnection
friend

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