RSB  0.9.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
rsb::transport::socket::BusServer Class Reference

Instances of this class provide access to a socket-based bus for local and remote bus clients. More...

#include <BusServer.h>

Inheritance diagram for rsb::transport::socket::BusServer:
Inheritance graph
Collaboration diagram for rsb::transport::socket::BusServer:
Collaboration graph

Public Member Functions

 BusServer (boost::uint16_t port, bool tcpnodelay, boost::asio::io_service &service)
 
virtual ~BusServer ()
 
void activate ()
 Activate the object. More...
 
void deactivate ()
 
void handleIncoming (EventPtr event, BusConnectionPtr connection)
 
- Public Member Functions inherited from rsb::transport::socket::Bus
 Bus (boost::asio::io_service &service, bool tcpnodelay=false)
 
virtual ~Bus ()
 
void addSink (InConnectorPtr sink)
 
void removeSink (InConnector *sink)
 
void addConnector (ConnectorBase *connector)
 
void removeConnector (ConnectorBase *connector)
 
void addConnection (BusConnectionPtr connection)
 Adds connection to the list of connections of the bus. More...
 
void removeConnection (BusConnectionPtr connection)
 Removes connection from the list of connections of this bus. More...
 
bool isTcpnodelay () const
 
void handle (EventPtr event)
 Handle event. More...
 
- Public Member Functions inherited from rsb::eventprocessing::Handler
virtual ~Handler ()
 

Private Types

typedef boost::shared_ptr
< boost::asio::ip::tcp::socket > 
SocketPtr
 

Private Member Functions

void acceptOne (boost::shared_ptr< BusServer > ref)
 
void handleAccept (boost::shared_ptr< BusServer > ref, SocketPtr socket, const boost::system::error_code &error)
 
void suicide ()
 

Private Attributes

rsc::logging::LoggerPtr logger
 
boost::asio::ip::tcp::acceptor acceptor
 
boost::asio::io_service & service
 
volatile bool active
 
volatile bool shutdown
 

Additional Inherited Members

- Protected Types inherited from rsb::transport::socket::Bus
typedef std::list
< BusConnectionPtr
ConnectionList
 
- Protected Member Functions inherited from rsb::transport::socket::Bus
ConnectionList getConnections () const
 
boost::recursive_mutex & getConnectionLock ()
 

Detailed Description

Instances of this class provide access to a socket-based bus for local and remote bus clients.

Remote clients can connect to a server socket in order to send and receive events through the resulting socket connection.

Local clients (connectors) use the usual Bus interface to receive events submitted by remote clients and submit events which will be distributed to remote clients by the BusServer.

Author
jmoringe

Definition at line 59 of file BusServer.h.

Member Typedef Documentation

typedef boost::shared_ptr<boost::asio::ip::tcp::socket> rsb::transport::socket::BusServer::SocketPtr
private

Definition at line 81 of file BusServer.h.

Constructor & Destructor Documentation

rsb::transport::socket::BusServer::BusServer ( boost::uint16_t  port,
bool  tcpnodelay,
boost::asio::io_service &  service 
)

Definition at line 49 of file BusServer.cpp.

rsb::transport::socket::BusServer::~BusServer ( )
virtual

Definition at line 60 of file BusServer.cpp.

References active, and deactivate().

Here is the call graph for this function:

Member Function Documentation

void rsb::transport::socket::BusServer::acceptOne ( boost::shared_ptr< BusServer ref)
private

Definition at line 83 of file BusServer.cpp.

References acceptor, handleAccept(), logger, and service.

Referenced by activate(), and handleAccept().

Here is the call graph for this function:

Here is the caller graph for this function:

void rsb::transport::socket::BusServer::activate ( )

Activate the object.

Note
This member function can only be called when a boost::shared_ptr owning the object exists.

Definition at line 66 of file BusServer.cpp.

References acceptOne(), and active.

Here is the call graph for this function:

void rsb::transport::socket::BusServer::deactivate ( )

Definition at line 72 of file BusServer.cpp.

References acceptor, active, and shutdown.

Referenced by ~BusServer().

Here is the caller graph for this function:

void rsb::transport::socket::BusServer::handleAccept ( boost::shared_ptr< BusServer ref,
SocketPtr  socket,
const boost::system::error_code &  error 
)
private

Definition at line 92 of file BusServer.cpp.

References acceptOne(), rsb::transport::socket::Bus::addConnection(), rsb::transport::socket::Bus::BusConnection, rsb::transport::socket::Bus::isTcpnodelay(), logger, and shutdown.

Referenced by acceptOne().

Here is the call graph for this function:

Here is the caller graph for this function:

void rsb::transport::socket::BusServer::handleIncoming ( EventPtr  event,
BusConnectionPtr  connection 
)
virtual
void rsb::transport::socket::BusServer::suicide ( )
privatevirtual

Reimplemented from rsb::transport::socket::Bus.

Definition at line 152 of file BusServer.cpp.

Member Data Documentation

boost::asio::ip::tcp::acceptor rsb::transport::socket::BusServer::acceptor
private

Definition at line 85 of file BusServer.h.

Referenced by acceptOne(), and deactivate().

volatile bool rsb::transport::socket::BusServer::active
private

Definition at line 88 of file BusServer.h.

Referenced by activate(), deactivate(), and ~BusServer().

rsc::logging::LoggerPtr rsb::transport::socket::BusServer::logger
private

Definition at line 83 of file BusServer.h.

Referenced by acceptOne(), handleAccept(), and handleIncoming().

boost::asio::io_service& rsb::transport::socket::BusServer::service
private

Definition at line 86 of file BusServer.h.

Referenced by acceptOne().

volatile bool rsb::transport::socket::BusServer::shutdown
private

Definition at line 89 of file BusServer.h.

Referenced by deactivate(), and handleAccept().


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