types.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_TYPES_H
#define BOOSTER_AIO_TYPES_H
#include <booster/config.h>
#include <stddef.h>
namespace booster {
template<typename F>
class callback;
namespace system {
class error_code;
}
namespace aio {
class endpoint;
class io_service;
#ifdef BOOSTER_DOXYGEN_DOCS
typedef unspecified native_type;
static const native_type invalid_socket = unspecified;
#elif defined BOOSTER_WIN32
typedef unsigned native_type;
static const unsigned invalid_socket = (unsigned)(-1);
#else
typedef int native_type;
static const int invalid_socket = -1;
#endif
typedef callback<void(system::error_code const &)> event_handler;
typedef callback<void()> handler;
typedef callback<void(system::error_code const &,size_t)> io_handler;
typedef enum {
pf_unix, //< Unix domain socket
pf_inet, //< IPv4 socket
pf_inet6 //< IPv6 socket
} family_type;
typedef enum {
sock_stream, //< Stream socket (like TCP/IP)
sock_datagram //< Datagram socket (like UDP)
} socket_type;
struct io_events {
static const int in = 1 << 0; //< Event socket readability
static const int out = 1 << 1; //< Event socket writability
static const int err = 1 << 2; //< Error on socket or OOB data
};
}
}
#endif
booster::aio::socket_type
socket_type
Definition: types.h:77
booster::aio::io_events
the struct that collects multiple event types for polling.
Definition: types.h:86
booster::callback
Definition: callback.h:18
booster::aio::event_handler
callback< void(system::error_code const &)> event_handler
Definition: types.h:53
booster::aio::family_type
family_type
Definition: types.h:68
booster::aio::native_type
unspecified native_type
Definition: types.h:29
booster::aio::handler
callback< void()> handler
Definition: types.h:58
booster::aio::io_handler
callback< void(system::error_code const &, size_t)> io_handler
Definition: types.h:63
booster::aio::io_service
this is the central event loop that dispatches all requests.
Definition: io_service.h:37