RSB
0.15.1
|
Instances of this class provide access to a socket-based bus for local and remote bus clients. More...
#include <BusServerImpl.h>
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::BusServer | |
BusServer (AsioServiceContextPtr asioService, bool tcpnodelay) | |
virtual | ~BusServer () |
Public Member Functions inherited from rsb::transport::socket::Bus | |
Bus (AsioServiceContextPtr asioService, bool tcpnodelay=false) | |
virtual | ~Bus () |
virtual void | addSink (InConnectorPtr sink) |
virtual void | removeSink (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 AsioServiceContextPtr | getService () const |
virtual void | printContents (std::ostream &stream) const |
Public Member Functions inherited from rsb::eventprocessing::Handler | |
virtual | ~Handler () |
Protected Types | |
typedef boost::shared_ptr< boost::asio::ip::tcp::socket > | SocketPtr |
Protected Types inherited from rsb::transport::socket::Bus | |
typedef std::list< BusConnectionPtr > | ConnectionList |
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::Bus | |
ConnectionList | getConnections () const |
boost::recursive_mutex & | getConnectionLock () |
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.
Definition at line 59 of file BusServerImpl.h.
|
protected |
Definition at line 83 of file BusServerImpl.h.
rsb::transport::socket::BusServerImpl::BusServerImpl | ( | AsioServiceContextPtr | asioService, |
boost::uint16_t | port, | ||
bool | tcpnodelay | ||
) |
Definition at line 49 of file BusServerImpl.cpp.
|
virtual |
Definition at line 59 of file BusServerImpl.cpp.
References active, deactivate(), and logger.
|
private |
Definition at line 85 of file BusServerImpl.cpp.
References acceptor, rsb::transport::socket::Bus::getService(), handleAccept(), and logger.
Referenced by activate(), and handleAccept().
|
virtual |
Activate the object.
Implements rsb::transport::socket::BusServer.
Definition at line 66 of file BusServerImpl.cpp.
References acceptOne(), active, and logger.
|
virtual |
Implements rsb::transport::socket::BusServer.
Definition at line 73 of file BusServerImpl.cpp.
References acceptor, active, logger, and shutdown.
Referenced by ~BusServerImpl().
|
virtual |
Reimplemented from rsb::transport::socket::Bus.
Definition at line 154 of file BusServerImpl.cpp.
References acceptor.
|
private |
Definition at line 94 of file BusServerImpl.cpp.
References acceptOne(), rsb::transport::socket::Bus::addConnection(), rsb::transport::socket::Bus::BusConnection, rsb::transport::socket::Bus::isTcpnodelay(), logger, and shutdown.
Referenced by acceptOne().
|
virtual |
Implements rsb::transport::socket::BusServer.
Definition at line 119 of file BusServerImpl.cpp.
References rsb::transport::socket::Bus::connections, rsb::transport::socket::Bus::getConnectionLock(), rsb::transport::socket::Bus::getConnections(), rsb::transport::socket::Bus::handleIncoming(), logger, and rsb::transport::socket::Bus::removeConnection().
|
private |
Definition at line 88 of file BusServerImpl.h.
Referenced by acceptOne(), deactivate(), and getTransportURL().
|
private |
Definition at line 90 of file BusServerImpl.h.
Referenced by activate(), deactivate(), and ~BusServerImpl().
|
private |
Definition at line 86 of file BusServerImpl.h.
Referenced by acceptOne(), activate(), deactivate(), handleAccept(), handleIncoming(), and ~BusServerImpl().
|
private |
Definition at line 91 of file BusServerImpl.h.
Referenced by deactivate(), and handleAccept().