1 #ifndef FACT_Connection 2 #define FACT_Connection 8 #include <boost/asio.hpp> 9 #include <boost/function.hpp> 10 #include <boost/asio/deadline_timer.hpp> 23 boost::asio::serial_port_base::parity
fParity;
47 std::ostream &
Out() {
return fLog ? fLog->
Out() :
Out(); }
52 void AsyncWrite(
const boost::asio::const_buffers_1 &buffers);
53 void AsyncWait(boost::asio::deadline_timer &timer,
int millisec,
60 void ConnectImp(
const boost::system::error_code& error,
61 boost::asio::ip::tcp::resolver::iterator endpoint_iterator);
64 void HandleSentData(
const boost::system::error_code& error,
size_t);
72 ConnectionUSB(boost::asio::io_service& io_service, std::ostream &out);
85 void PostMessage(
const std::string &cmd,
size_t s=-1);
87 template<
typename T,
size_t N>
boost::asio::deadline_timer fOutTimeout
boost::asio::serial_port_base::character_size fCharacterSize
boost::asio::serial_port_base::flow_control fFlowControl
void SetLogStream(MessageImp *log)
void SetEndpoint(const std::string &addr)
void PostMessage(const void *msg, size_t s=0)
void CloseImp(int64_t delay=0)
The base implementation of a distributed messaging system.
void AsyncWrite(const boost::asio::const_buffers_1 &buffers)
void ConnectImp(const boost::system::error_code &error, boost::asio::ip::tcp::resolver::iterator endpoint_iterator)
void AsyncWait(boost::asio::deadline_timer &timer, int millisec, void(ConnectionUSB::*handler)(const boost::system::error_code &))
Adds some functionality to boost::posix_time::ptime for our needs.
void AsyncRead(const boost::asio::mutable_buffers_1 buffers, int type=0, int counter=0)
virtual void HandleReceivedData(const boost::system::error_code &, size_t, int=0, int=0)
boost::asio::serial_port_base::baud_rate fBaudRate
void PostMessage(const std::array< T, N > &msg)
std::ostream & Out() const
bool IsConnecting() const
An info telling something which can be interesting to know.
virtual void HandleReadTimeout(const boost::system::error_code &)
void HandleSentData(const boost::system::error_code &error, size_t)
ConnectionUSB(boost::asio::io_service &io_service, std::ostream &out)
virtual void ConnectionEstablished()
void HandleWriteTimeout(const boost::system::error_code &error)
ConnectionStatus_t fConnectionStatus
boost::asio::serial_port_base::stop_bits fStopBits
boost::asio::serial_port_base::parity fParity
void HandleReconnectTimeout(const boost::system::error_code &error)
void PostMessage(const std::vector< T > &msg)
void PostClose(int64_t delay=0)
static void handler(int conn_id, char *packet, int size, int status)
boost::asio::deadline_timer fInTimeout
int Write(const Time &t, const std::string &txt, int qos=kInfo)
boost::asio::deadline_timer fConnectTimeout
virtual void HandleTransmittedData(size_t)