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 #ifndef NET_BASE_TCP_CLIENT_SOCKET_H_ | 5 #ifndef NET_BASE_TCP_CLIENT_SOCKET_H_ |
6 #define NET_BASE_TCP_CLIENT_SOCKET_H_ | 6 #define NET_BASE_TCP_CLIENT_SOCKET_H_ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 | 9 |
10 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 NOT_WAITING, | 79 NOT_WAITING, |
80 WAITING_CONNECT, | 80 WAITING_CONNECT, |
81 WAITING_READ, | 81 WAITING_READ, |
82 WAITING_WRITE | 82 WAITING_WRITE |
83 }; | 83 }; |
84 WaitState wait_state_; | 84 WaitState wait_state_; |
85 | 85 |
86 // base::ObjectWatcher::Delegate methods: | 86 // base::ObjectWatcher::Delegate methods: |
87 virtual void OnObjectSignaled(HANDLE object); | 87 virtual void OnObjectSignaled(HANDLE object); |
88 | 88 |
89 // After a Winsock function succeeds synchronously, waits for the | 89 // Waits for the (manual-reset) event object to become signaled and resets |
90 // (manual-reset) event object to become signaled and resets it. | 90 // it. Called after a Winsock function succeeds synchronously |
91 // | 91 // |
92 // Our testing shows that except in rare cases (when running inside QEMU), | 92 // Our testing shows that except in rare cases (when running inside QEMU), |
93 // the event object is already signaled at this point, so we just call this | 93 // the event object is already signaled at this point, so we just call this |
94 // method on the IO thread to avoid a context switch. | 94 // method on the IO thread to avoid a context switch. |
95 void WaitForAndResetEvent(); | 95 void WaitForAndResetEvent(); |
96 | 96 |
97 OVERLAPPED overlapped_; | 97 OVERLAPPED overlapped_; |
98 WSABUF buffer_; | 98 WSABUF buffer_; |
99 | 99 |
100 base::ObjectWatcher watcher_; | 100 base::ObjectWatcher watcher_; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 | 132 |
133 int CreateSocket(const struct addrinfo* ai); | 133 int CreateSocket(const struct addrinfo* ai); |
134 void DoCallback(int rv); | 134 void DoCallback(int rv); |
135 void DidCompleteConnect(); | 135 void DidCompleteConnect(); |
136 }; | 136 }; |
137 | 137 |
138 } // namespace net | 138 } // namespace net |
139 | 139 |
140 #endif // NET_BASE_TCP_CLIENT_SOCKET_H_ | 140 #endif // NET_BASE_TCP_CLIENT_SOCKET_H_ |
141 | 141 |
OLD | NEW |