|
@@ -19,31 +19,26 @@ private:
|
|
|
|
|
|
public:
|
|
|
typedef boost::shared_ptr<con_handler> pointer;
|
|
|
- con_handler(
|
|
|
- basic_socket_acceptor<ip::tcp>::executor_type
|
|
|
- &io_service)
|
|
|
+ con_handler(basic_socket_acceptor<ip::tcp>::executor_type &io_service)
|
|
|
: sock(io_service) {}
|
|
|
|
|
|
static pointer
|
|
|
- create(basic_socket_acceptor<ip::tcp>::executor_type
|
|
|
- &io_service) {
|
|
|
+ create(basic_socket_acceptor<ip::tcp>::executor_type &io_service) {
|
|
|
return pointer(new con_handler(io_service));
|
|
|
}
|
|
|
|
|
|
tcp::socket &socket() { return sock; }
|
|
|
|
|
|
void start() {
|
|
|
- sock.async_read_some(
|
|
|
- buffer(data, max_length),
|
|
|
- boost::bind(&con_handler::handle_read, shared_from_this(),
|
|
|
- placeholders::error,
|
|
|
- placeholders::bytes_transferred));
|
|
|
+ sock.async_read_some(buffer(data, max_length),
|
|
|
+ boost::bind(&con_handler::handle_read,
|
|
|
+ shared_from_this(), placeholders::error,
|
|
|
+ placeholders::bytes_transferred));
|
|
|
|
|
|
- sock.async_write_some(
|
|
|
- buffer(message, max_length),
|
|
|
- boost::bind(&con_handler::handle_write, shared_from_this(),
|
|
|
- placeholders::error,
|
|
|
- placeholders::bytes_transferred));
|
|
|
+ sock.async_write_some(buffer(message, max_length),
|
|
|
+ boost::bind(&con_handler::handle_write,
|
|
|
+ shared_from_this(), placeholders::error,
|
|
|
+ placeholders::bytes_transferred));
|
|
|
}
|
|
|
|
|
|
void handle_read(const boost::system::error_code &err,
|