OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef TOOLS_ANDROID_FORWARDER2_SOCKET_H_ | 5 #ifndef TOOLS_ANDROID_FORWARDER2_SOCKET_H_ |
6 #define TOOLS_ANDROID_FORWARDER2_SOCKET_H_ | 6 #define TOOLS_ANDROID_FORWARDER2_SOCKET_H_ |
7 | 7 |
8 #include <fcntl.h> | 8 #include <fcntl.h> |
9 #include <netinet/in.h> | 9 #include <netinet/in.h> |
| 10 #include <stddef.h> |
10 #include <sys/socket.h> | 11 #include <sys/socket.h> |
11 #include <sys/un.h> | 12 #include <sys/un.h> |
12 | 13 |
13 #include <string> | 14 #include <string> |
14 #include <vector> | 15 #include <vector> |
15 | 16 |
16 #include "base/basictypes.h" | 17 #include "base/macros.h" |
17 | 18 |
18 namespace forwarder2 { | 19 namespace forwarder2 { |
19 | 20 |
20 // Wrapper class around unix socket api. Can be used to create, bind or | 21 // Wrapper class around unix socket api. Can be used to create, bind or |
21 // connect to both Unix domain sockets and TCP sockets. | 22 // connect to both Unix domain sockets and TCP sockets. |
22 // TODO(pliard): Split this class into TCPSocket and UnixDomainSocket. | 23 // TODO(pliard): Split this class into TCPSocket and UnixDomainSocket. |
23 class Socket { | 24 class Socket { |
24 public: | 25 public: |
25 Socket(); | 26 Socket(); |
26 ~Socket(); | 27 ~Socket(); |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 // Used to listen for external events (e.g. process received a SIGTERM) while | 143 // Used to listen for external events (e.g. process received a SIGTERM) while |
143 // blocking on I/O operations. | 144 // blocking on I/O operations. |
144 std::vector<Event> events_; | 145 std::vector<Event> events_; |
145 | 146 |
146 DISALLOW_COPY_AND_ASSIGN(Socket); | 147 DISALLOW_COPY_AND_ASSIGN(Socket); |
147 }; | 148 }; |
148 | 149 |
149 } // namespace forwarder | 150 } // namespace forwarder |
150 | 151 |
151 #endif // TOOLS_ANDROID_FORWARDER2_SOCKET_H_ | 152 #endif // TOOLS_ANDROID_FORWARDER2_SOCKET_H_ |
OLD | NEW |