CppCMS
endpoint.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_ENDPOINT_H
9 #define BOOSTER_AIO_ENDPOINT_H
10 
11 #include <booster/config.h>
12 #include <booster/copy_ptr.h>
13 #include <booster/aio/types.h>
14 #include <string>
15 
16 extern "C" {
17  struct sockaddr;
18 };
19 
20 namespace booster {
21 namespace aio {
26  class BOOSTER_API endpoint {
27  public:
28  endpoint();
29  endpoint(endpoint const &);
30  endpoint const &operator = (endpoint const &);
31  ~endpoint();
32 
38  endpoint(std::string const &ip,int port);
39 
45  void ip(std::string const &);
51  void port(int);
52 
58  std::string ip() const;
64  int port() const;
65 
66 #ifndef BOOSTER_WIN32
67  endpoint(std::string const &);
78  void path(std::string const &);
85  std::string path() const;
86 #endif
87 
93  family_type family() const;
94 
98  void raw(sockaddr const *p,int size);
102  typedef std::pair<sockaddr const *,int> native_address_type;
106  native_address_type raw() const;
107 
108  private:
109  void throw_invalid() const;
110  struct data;
111  copy_ptr<data> d;
112  };
113 } // aio
114 } // booster
115 
116 
117 
118 #endif
this class represents the connection endpoint, that is generally sockaddr structure in Berkeley socke...
Definition: endpoint.h:26
std::pair< sockaddr const *, int > native_address_type
Definition: endpoint.h:102
family_type
Definition: types.h:68
Booster library namespace. The library that implements Boost Like API in ABI backward compatible way...
Definition: application.h:23