| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "net/socket/tcp_server_socket_win.h" | 5 #include "net/socket/tcp_server_socket_win.h" |
| 6 | 6 |
| 7 #include <mstcpip.h> | 7 #include <mstcpip.h> |
| 8 | 8 |
| 9 #include "net/base/ip_endpoint.h" | 9 #include "net/base/ip_endpoint.h" |
| 10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 WSANETWORKEVENTS ev; | 175 WSANETWORKEVENTS ev; |
| 176 if (WSAEnumNetworkEvents(socket_, socket_event_, &ev) == SOCKET_ERROR) { | 176 if (WSAEnumNetworkEvents(socket_, socket_event_, &ev) == SOCKET_ERROR) { |
| 177 PLOG(ERROR) << "WSAEnumNetworkEvents()"; | 177 PLOG(ERROR) << "WSAEnumNetworkEvents()"; |
| 178 return; | 178 return; |
| 179 } | 179 } |
| 180 | 180 |
| 181 if (ev.lNetworkEvents & FD_ACCEPT) { | 181 if (ev.lNetworkEvents & FD_ACCEPT) { |
| 182 int result = AcceptInternal(accept_socket_); | 182 int result = AcceptInternal(accept_socket_); |
| 183 if (result != ERR_IO_PENDING) { | 183 if (result != ERR_IO_PENDING) { |
| 184 accept_socket_ = NULL; | 184 accept_socket_ = NULL; |
| 185 accept_callback_.Run(result); | 185 CompletionCallback callback = accept_callback_; |
| 186 accept_callback_.Reset(); | 186 accept_callback_.Reset(); |
| 187 callback.Run(result); |
| 187 } | 188 } |
| 188 } | 189 } |
| 189 } | 190 } |
| 190 | 191 |
| 191 } // namespace net | 192 } // namespace net |
| OLD | NEW |