basic_socket.h
//
// Copyright (C) 2009-2012 Artyom Beilis (Tonkikh)
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef BOOSTER_AIO_BASIC_SOCKET_H
#define BOOSTER_AIO_BASIC_SOCKET_H
#include <booster/aio/types.h>
#include <booster/hold_ptr.h>
#include <booster/noncopyable.h>
#include <booster/aio/endpoint.h>
#include <booster/aio/basic_io_device.h>
namespace booster {
namespace aio {
class io_service;
class BOOSTER_API basic_socket : public basic_io_device {
public:
basic_socket();
basic_socket(io_service &srv);
~basic_socket();
void open(family_type d,socket_type t);
void open(family_type d,socket_type t,system::error_code &e);
endpoint local_endpoint(system::error_code &e);
endpoint local_endpoint();
endpoint remote_endpoint(system::error_code &e);
endpoint remote_endpoint();
typedef enum {
tcp_no_delay, //< TCP_NODELAY options - disables Nagle's algorithm
keep_alive, //< SO_KEEPALIVE socket option
reuse_address //< SO_REUSEADDR socket option
} boolean_option_type;
bool get_option(boolean_option_type opt,system::error_code &e);
bool get_option(boolean_option_type opt);
void set_option(boolean_option_type opt,bool v,system::error_code &e);
void set_option(boolean_option_type opt,bool v);
private:
struct data;
hold_ptr<data> d;
};
} // aio
} // booster
#endif
booster::aio::basic_io_device
This is a basic object that allows execution of asynchronous operations.
Definition: basic_io_device.h:36
booster::aio::endpoint
this class represents the connection endpoint, that is generally sockaddr structure in Berkeley socke...
Definition: endpoint.h:26
booster::hold_ptr< data >
booster::aio::basic_socket
This class represents a basic Socket object.
Definition: basic_socket.h:26
booster::aio::socket_type
socket_type
Definition: types.h:77
booster::system::error_code
The lightweight object that carries a error code information and its category.
Definition: system_error.h:83
booster::aio::family_type
family_type
Definition: types.h:68
booster::aio::io_service
this is the central event loop that dispatches all requests.
Definition: io_service.h:37