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 <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 
54 
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
socket_type
Definition: types.h:77
the struct that collects multiple event types for polling.
Definition: types.h:86
Definition: callback.h:18
static const native_type invalid_socket
Definition: types.h:39
family_type
Definition: types.h:68
unspecified native_type
Definition: types.h:29
Booster library namespace. The library that implements Boost Like API in ABI backward compatible way...
Definition: application.h:23
this is the central event loop that dispatches all requests.
Definition: io_service.h:37