24 #ifndef GOBY_MIDDLEWARE_IO_COBS_TCP_SERVER_H
25 #define GOBY_MIDDLEWARE_IO_COBS_TCP_SERVER_H
32 #include <boost/asio/ip/tcp.hpp>
33 #include <boost/asio/read_until.hpp>
34 #include <boost/asio/streambuf.hpp>
35 #include <boost/system/error_code.hpp>
57 template <
typename TCPServerThreadType>
61 TCPSessionCOBS(boost::asio::ip::tcp::socket socket, TCPServerThreadType& server)
66 template <
class Thread>
68 std::shared_ptr<const goby::middleware::protobuf::IOData> io_msg);
70 template <
class Thread,
class ThreadBase>
74 void async_read()
override
76 auto self(this->shared_from_this());
80 void async_write(std::shared_ptr<const goby::middleware::protobuf::IOData> io_msg)
override
86 boost::asio::streambuf buffer_;
97 bool use_indexed_groups =
false>
100 subscribe_layer, Config, ThreadType, use_indexed_groups>
103 subscribe_layer, Config, ThreadType, use_indexed_groups>;
109 void start_session(boost::asio::ip::tcp::socket tcp_socket)
111 std::make_shared<TCPSessionCOBS<Base>>(std::move(tcp_socket), *
this)->start();