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 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 #if defined(OS_WIN) | 107 #if defined(OS_WIN) |
108 // ObjectWatcher delegate | 108 // ObjectWatcher delegate |
109 virtual void OnObjectSignaled(HANDLE object); | 109 virtual void OnObjectSignaled(HANDLE object); |
110 base::ObjectWatcher watcher_; | 110 base::ObjectWatcher watcher_; |
111 HANDLE socket_event_; | 111 HANDLE socket_event_; |
112 #elif defined(OS_POSIX) | 112 #elif defined(OS_POSIX) |
113 WaitState wait_state_; | 113 WaitState wait_state_; |
114 // The socket's libevent wrapper | 114 // The socket's libevent wrapper |
115 MessageLoopForIO::FileDescriptorWatcher watcher_; | 115 MessageLoopForIO::FileDescriptorWatcher watcher_; |
116 // Called by MessagePumpLibevent when the socket is ready to do I/O | 116 // Called by MessagePumpLibevent when the socket is ready to do I/O |
117 void OnFileCanReadWithoutBlocking(int fd); | 117 virtual void OnFileCanReadWithoutBlocking(int fd); |
118 void OnFileCanWriteWithoutBlocking(int fd); | 118 virtual void OnFileCanWriteWithoutBlocking(int fd); |
119 #endif | 119 #endif |
120 | 120 |
121 SOCKET socket_; | 121 SOCKET socket_; |
122 ListenSocketDelegate *socket_delegate_; | 122 ListenSocketDelegate *socket_delegate_; |
123 | 123 |
124 private: | 124 private: |
125 bool reads_paused_; | 125 bool reads_paused_; |
126 bool has_pending_reads_; | 126 bool has_pending_reads_; |
127 | 127 |
128 DISALLOW_COPY_AND_ASSIGN(ListenSocket); | 128 DISALLOW_COPY_AND_ASSIGN(ListenSocket); |
129 }; | 129 }; |
130 | 130 |
131 #endif // NET_BASE_LISTEN_SOCKET_H_ | 131 #endif // NET_BASE_LISTEN_SOCKET_H_ |
OLD | NEW |