31 #include <boost/enable_shared_from_this.hpp>
33 #include <boost/thread/recursive_mutex.hpp>
35 #include <boost/asio.hpp>
37 #include <rsc/logging/Logger.h>
38 #include <rsc/runtime/Printable.h>
40 #include "../../Event.h"
42 #include "../../protocol/Notification.h"
44 #include "rsb/rsbexports.h"
52 typedef boost::shared_ptr<Bus>
BusPtr;
74 class RSB_EXPORT
BusConnection :
public boost::enable_shared_from_this<BusConnection>,
75 public rsc::runtime::Printable {
77 typedef boost::shared_ptr<boost::asio::ip::tcp::socket>
SocketPtr;
82 bool tcpNoDelay =
false);
88 void startReceiving();
91 const std::string& wireSchema);
115 void performSafeCleanup(
const std::string& context);
119 void handleReadLength(
const boost::system::error_code& error,
120 size_t bytesTransferred);
122 void handleReadBody(
const boost::system::error_code& error,
123 size_t bytesTransferred,
126 void printContents(std::ostream& stream)
const;
volatile bool activeShutdown
Instances of this class provide access to a socket-based bus.
boost::shared_ptr< BusConnection > BusConnectionPtr
boost::weak_ptr< Bus > WeakBusPtr
std::string lengthSendBuffer
rsc::logging::LoggerPtr logger
std::string messageReceiveBuffer
boost::recursive_mutex mutex
std::string messageSendBuffer
volatile bool disconnecting
Instances of this class implement connections to a socket-based bus.
boost::shared_ptr< boost::asio::ip::tcp::socket > SocketPtr
std::string lengthReceiveBuffer
protocol::Notification notification
boost::shared_ptr< Event > EventPtr
boost::shared_ptr< Bus > BusPtr