clean up Makefile
[anytun.git] / src / syncTcpConnection.cpp
blobdf6f59fb3f7d8793ef293c08b7317cc48c569183
1 #include "syncTcpConnection.h"
2 #include <boost/bind.hpp>
3 #include <boost/asio.hpp>
5 #include <sstream>
6 #include <iostream>
7 #include <string>
8 #include "routingTable.h"
9 #include "rtpSessionTable.h"
10 #include <boost/archive/text_oarchive.hpp>
11 #include <boost/archive/text_iarchive.hpp>
14 #include "syncCommand.h"
15 #include "buffer.h"
17 SyncTcpConnection::proto::socket& SyncTcpConnection::socket()
19 return socket_;
22 void SyncTcpConnection::start()
24 onConnect(this);
27 void SyncTcpConnection::Send(std::string message)
29 boost::asio::async_write(socket_, boost::asio::buffer(message),
30 boost::bind(&SyncTcpConnection::handle_write, shared_from_this(),
31 boost::asio::placeholders::error,
32 boost::asio::placeholders::bytes_transferred));
34 SyncTcpConnection::SyncTcpConnection(boost::asio::io_service& io_service)
35 : socket_(io_service)
39 void SyncTcpConnection::handle_write(const boost::system::error_code& /*error*/,
40 size_t /*bytes_transferred*/)