#ifndef _SYNCTCPCONNECTION_H_ #define _SYNCTCPCONNECTION_H_ #include #include #include #include #include class SyncTcpConnection : public boost::enable_shared_from_this { public: typedef boost::shared_ptr pointer; typedef boost::asio::ip::tcp proto; static pointer create(boost::asio::io_service& io_service) { return pointer(new SyncTcpConnection(io_service)); }; boost::function onConnect; proto::socket& socket(); void start(); void Send(std::string message); private: SyncTcpConnection(boost::asio::io_service& io_service); void handle_write(const boost::system::error_code & /*error*/, size_t /*bytes_transferred*/); proto::socket socket_; }; #endif