CppCMS
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 <booster/system_error.h>
13 #include <stddef.h>
14 
15 namespace booster {
16  template<typename F>
17  class callback;
18 
19 
24  namespace aio {
25  class endpoint;
26  class io_service;
27 
28  #ifdef BOOSTER_DOXYGEN_DOCS
29  typedef unspecified native_type;
36  static const native_type invalid_socket = unspecified;
37 
38  #elif defined BOOSTER_WIN32
39  typedef unsigned native_type;
40  static const unsigned invalid_socket = (unsigned)(-1);
41  #else
42  typedef int native_type;
43  static const int invalid_socket = -1;
44  #endif
45 
51 
61 
65  typedef enum {
66  pf_unix, //< Unix domain socket
67  pf_inet, //< IPv4 socket
68  pf_inet6 //< IPv6 socket
69  } family_type;
70 
74  typedef enum {
75  sock_stream, //< Stream socket (like TCP/IP)
76  sock_datagram //< Datagram socket (like UDP)
77  } socket_type;
78 
83  struct io_events {
84  static const int in = 1 << 0; //< Event socket readability
85  static const int out = 1 << 1; //< Event socket writability
86  static const int err = 1 << 2; //< Error on socket or OOB data
87  };
88  }
89 }
90 
91 
92 #endif
socket_type
Definition: types.h:74
the struct that collects multiple event types for polling.
Definition: types.h:83
Definition: callback.h:18
callback< void(system::error_code const &)> event_handler
Definition: types.h:50
static const native_type invalid_socket
Definition: types.h:36
family_type
Definition: types.h:65
unspecified native_type
Definition: types.h:26
callback< void()> handler
Definition: types.h:55
Booster library namespace. The library that implements Boost Like API in ABI backward compatible way...
Definition: application.h:23
callback< void(system::error_code const &, size_t)> io_handler
Definition: types.h:60
this is the central event loop that dispatches all requests.
Definition: io_service.h:37