CppCMS

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

types.h
1 //
2 // Copyright (C) 2009-2012 Artyom Beilis (Tonkikh)
3 //
4 // Distributed under the Boost Software License, Version 1.0. (See
5 // accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt)
7 //
8 #ifndef BOOSTER_AIO_TYPES_H
9 #define BOOSTER_AIO_TYPES_H
10
11 #include <booster/config.h>
12 #include <stddef.h>
13
14 namespace booster {
15 template<typename F>
16 class callback;
17
18 namespace system {
19 class error_code;
20 }
21
22
27 namespace aio {
28 class endpoint;
29 class io_service;
30
31 #ifdef BOOSTER_DOXYGEN_DOCS
32 typedef unspecified native_type;
39 static const native_type invalid_socket = unspecified;
40
41 #elif defined BOOSTER_WIN32
42 typedef unsigned native_type;
43 static const unsigned invalid_socket = (unsigned)(-1);
44 #else
45 typedef int native_type;
46 static const int invalid_socket = -1;
47 #endif
48
53 typedef callback<void(system::error_code const &)> event_handler;
54
58 typedef callback<void()> handler;
63 typedef callback<void(system::error_code const &,size_t)> io_handler;
64
68 typedef enum {
69 pf_unix, //< Unix domain socket
70 pf_inet, //< IPv4 socket
71 pf_inet6 //< IPv6 socket
72 } family_type;
73
77 typedef enum {
78 sock_stream, //< Stream socket (like TCP/IP)
79 sock_datagram //< Datagram socket (like UDP)
80 } socket_type;
81
86 struct io_events {
87 static const int in = 1 << 0; //< Event socket readability
88 static const int out = 1 << 1; //< Event socket writability
89 static const int err = 1 << 2; //< Error on socket or OOB data
90 };
91 }
92 }
93
94
95 #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::invalid_socket
static const native_type invalid_socket
Definition: types.h:39
booster::aio::family_type
family_type
Definition: types.h:68
booster::aio::native_type
unspecified native_type
Definition: types.h:29
booster
Booster library namespace. The library that implements Boost Like API in ABI backward compatible way...
Definition: application.h:23
booster::aio::io_service
this is the central event loop that dispatches all requests.
Definition: io_service.h:37