OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // TCP/IP server that handles IO asynchronously in the specified MessageLoop. | 5 // TCP/IP server that handles IO asynchronously in the specified MessageLoop. |
6 // These objects are NOT thread safe. They use WSAEVENT handles to monitor | 6 // These objects are NOT thread safe. They use WSAEVENT handles to monitor |
7 // activity in a given MessageLoop. This means that callbacks will | 7 // activity in a given MessageLoop. This means that callbacks will |
8 // happen in that loop's thread always and that all other methods (including | 8 // happen in that loop's thread always and that all other methods (including |
9 // constructors and destructors) should also be called from the same thread. | 9 // constructors and destructors) should also be called from the same thread. |
10 | 10 |
11 #ifndef NET_BASE_LISTEN_SOCKET_H_ | 11 #ifndef NET_BASE_LISTEN_SOCKET_H_ |
12 #define NET_BASE_LISTEN_SOCKET_H_ | 12 #define NET_BASE_LISTEN_SOCKET_H_ |
13 | 13 |
| 14 #include "build/build_config.h" |
| 15 |
14 #if defined(OS_WIN) | 16 #if defined(OS_WIN) |
15 #include <winsock2.h> | 17 #include <winsock2.h> |
16 #endif | 18 #endif |
17 #include <string> | 19 #include <string> |
18 #if defined(OS_WIN) | 20 #if defined(OS_WIN) |
19 #include "base/object_watcher.h" | 21 #include "base/object_watcher.h" |
20 #elif defined(OS_POSIX) | 22 #elif defined(OS_POSIX) |
21 #include "base/message_loop.h" | 23 #include "base/message_loop.h" |
22 #include "net/base/net_util.h" | |
23 #include "net/base/net_errors.h" | |
24 #endif | 24 #endif |
25 | 25 |
26 #include "base/basictypes.h" | 26 #include "base/basictypes.h" |
27 #include "base/ref_counted.h" | 27 #include "base/ref_counted.h" |
28 | 28 |
29 #if defined(OS_POSIX) | 29 #if defined(OS_POSIX) |
30 struct event; // From libevent | 30 struct event; // From libevent |
31 #define SOCKET int | 31 #define SOCKET int |
32 #endif | 32 #endif |
33 | 33 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 ListenSocketDelegate *socket_delegate_; | 114 ListenSocketDelegate *socket_delegate_; |
115 | 115 |
116 private: | 116 private: |
117 bool reads_paused_; | 117 bool reads_paused_; |
118 bool has_pending_reads_; | 118 bool has_pending_reads_; |
119 | 119 |
120 DISALLOW_COPY_AND_ASSIGN(ListenSocket); | 120 DISALLOW_COPY_AND_ASSIGN(ListenSocket); |
121 }; | 121 }; |
122 | 122 |
123 #endif // NET_BASE_LISTEN_SOCKET_H_ | 123 #endif // NET_BASE_LISTEN_SOCKET_H_ |
OLD | NEW |