RSB
0.7.0
|
Instances of this class provide access to a socket-based bus for local and remote bus clients. More...
#include <BusServer.h>
Public Member Functions | |
BusServer (boost::uint16_t port, bool tcpnodelay, boost::asio::io_service &service) | |
virtual | ~BusServer () |
void | activate () |
Activate the object. | |
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. | |
void | removeConnection (BusConnectionPtr connection) |
Removes connection from the list of connections of this bus. | |
bool | isTcpnodelay () const |
void | handle (EventPtr event) |
Handle event. | |
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 () |
virtual void | suicide () |
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.
Definition at line 59 of file BusServer.h.
|
private |
Definition at line 81 of file BusServer.h.
rsb::transport::socket::BusServer::BusServer | ( | boost::uint16_t | port, |
bool | tcpnodelay, | ||
boost::asio::io_service & | service | ||
) |
Definition at line 49 of file BusServer.cpp.
|
virtual |
Definition at line 60 of file BusServer.cpp.
References active, and deactivate().
|
private |
Definition at line 83 of file BusServer.cpp.
References acceptor, handleAccept(), logger, and service.
Referenced by activate(), and handleAccept().
void rsb::transport::socket::BusServer::activate | ( | ) |
Activate the object.
Definition at line 66 of file BusServer.cpp.
References acceptOne(), and active.
void rsb::transport::socket::BusServer::deactivate | ( | ) |
Definition at line 72 of file BusServer.cpp.
References acceptor, active, and shutdown.
Referenced by ~BusServer().
|
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().
|
virtual |
Reimplemented from rsb::transport::socket::Bus.
Definition at line 118 of file BusServer.cpp.
References rsb::transport::socket::Bus::connections, rsb::transport::socket::Bus::getConnectionLock(), rsb::transport::socket::Bus::getConnections(), logger, and rsb::transport::socket::Bus::removeConnection().
|
private |
Definition at line 153 of file BusServer.cpp.
|
private |
Definition at line 85 of file BusServer.h.
Referenced by acceptOne(), and deactivate().
|
private |
Definition at line 88 of file BusServer.h.
Referenced by activate(), deactivate(), and ~BusServer().
|
private |
Definition at line 83 of file BusServer.h.
Referenced by acceptOne(), handleAccept(), and handleIncoming().
|
private |
Definition at line 86 of file BusServer.h.
Referenced by acceptOne().
|
private |
Definition at line 89 of file BusServer.h.
Referenced by deactivate(), and handleAccept().