RSB  0.19.0
rsb::transport::socket::BusServerImpl Class Reference

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

#include <BusServerImpl.h>

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

Public Member Functions

 BusServerImpl (AsioServiceContextPtr asioService, boost::uint16_t port, bool tcpnodelay)
 
virtual ~BusServerImpl ()
 
void activate ()
 Activate the object. More...
 
void deactivate ()
 
void handleIncoming (EventPtr event, BusConnectionPtr connection)
 
virtual const std::string getTransportURL () const
 
- Public Member Functions inherited from rsb::transport::socket::BusImpl
 BusImpl (AsioServiceContextPtr asioService, bool tcpnodelay=false)
 
virtual ~BusImpl ()
 
virtual void addSink (InConnectorPtr sink)
 
virtual void removeSink (const InConnector *sink)
 
virtual void addConnection (BusConnectionPtr connection)
 Adds connection to the list of connections of the bus. More...
 
virtual void removeConnection (BusConnectionPtr connection)
 Removes connection from the list of connections of this bus. More...
 
virtual bool isTcpnodelay () const
 
virtual void handle (EventPtr event)
 Handle event. More...
 
virtual void printContents (std::ostream &stream) const
 
- Public Member Functions inherited from rsb::transport::socket::Bus
virtual ~Bus ()
 
- Public Member Functions inherited from rsb::eventprocessing::Handler
virtual ~Handler ()
 
- Public Member Functions inherited from rsb::transport::socket::BusServer
virtual ~BusServer ()
 

Protected Types

typedef boost::shared_ptr< boost::asio::ip::tcp::socket > SocketPtr
 
- Protected Types inherited from rsb::transport::socket::BusImpl
typedef std::list< BusConnectionPtrConnectionList
 

Private Member Functions

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

Private Attributes

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

Additional Inherited Members

- Protected Member Functions inherited from rsb::transport::socket::BusImpl
ConnectionList getConnections () const
 
boost::recursive_mutex & getConnectionLock ()
 
virtual AsioServiceContextPtr getService () const
 

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 BusServerImpl.

Author
jmoringe

Definition at line 60 of file BusServerImpl.h.

Member Typedef Documentation

typedef boost::shared_ptr<boost::asio::ip::tcp::socket> rsb::transport::socket::BusServerImpl::SocketPtr
protected

Definition at line 85 of file BusServerImpl.h.

Constructor & Destructor Documentation

rsb::transport::socket::BusServerImpl::BusServerImpl ( AsioServiceContextPtr  asioService,
boost::uint16_t  port,
bool  tcpnodelay 
)

Definition at line 49 of file BusServerImpl.cpp.

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

Definition at line 59 of file BusServerImpl.cpp.

References active, deactivate(), and logger.

Here is the call graph for this function:

Member Function Documentation

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

Definition at line 85 of file BusServerImpl.cpp.

References acceptor, rsb::transport::socket::BusImpl::getService(), handleAccept(), and logger.

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::BusServerImpl::activate ( )
virtual

Activate the object.

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

Implements rsb::transport::socket::BusServer.

Definition at line 66 of file BusServerImpl.cpp.

References acceptOne(), active, and logger.

Here is the call graph for this function:

void rsb::transport::socket::BusServerImpl::deactivate ( )
virtual

Implements rsb::transport::socket::BusServer.

Definition at line 73 of file BusServerImpl.cpp.

References acceptor, active, logger, and shutdown.

Referenced by ~BusServerImpl().

Here is the caller graph for this function:

const std::string rsb::transport::socket::BusServerImpl::getTransportURL ( ) const
virtual

Reimplemented from rsb::transport::socket::BusImpl.

Definition at line 154 of file BusServerImpl.cpp.

References acceptor.

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

Definition at line 94 of file BusServerImpl.cpp.

References acceptOne(), rsb::transport::socket::BusImpl::addConnection(), rsb::transport::socket::BusImpl::BusConnection, rsb::transport::socket::BusImpl::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::BusServerImpl::handleIncoming ( EventPtr  event,
BusConnectionPtr  connection 
)
virtual

Member Data Documentation

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

Definition at line 90 of file BusServerImpl.h.

Referenced by acceptOne(), deactivate(), and getTransportURL().

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

Definition at line 92 of file BusServerImpl.h.

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

rsc::logging::LoggerPtr rsb::transport::socket::BusServerImpl::logger
private
volatile bool rsb::transport::socket::BusServerImpl::shutdown
private

Definition at line 93 of file BusServerImpl.h.

Referenced by deactivate(), and handleAccept().


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