| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/globals.h" | 5 #include "platform/globals.h" |
| 6 #if defined(TARGET_OS_WINDOWS) | 6 #if defined(TARGET_OS_WINDOWS) |
| 7 | 7 |
| 8 #include "bin/eventhandler.h" | 8 #include "bin/eventhandler.h" |
| 9 | 9 |
| 10 #include <process.h> // NOLINT | 10 #include <process.h> // NOLINT |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 accepted_tail_ = client_socket; | 428 accepted_tail_ = client_socket; |
| 429 } else { | 429 } else { |
| 430 ASSERT(accepted_tail_ != NULL); | 430 ASSERT(accepted_tail_ != NULL); |
| 431 accepted_tail_->set_next(client_socket); | 431 accepted_tail_->set_next(client_socket); |
| 432 accepted_tail_ = client_socket; | 432 accepted_tail_ = client_socket; |
| 433 } | 433 } |
| 434 } else { | 434 } else { |
| 435 Log::PrintErr("setsockopt failed: %d\n", WSAGetLastError()); | 435 Log::PrintErr("setsockopt failed: %d\n", WSAGetLastError()); |
| 436 closesocket(buffer->client()); | 436 closesocket(buffer->client()); |
| 437 } | 437 } |
| 438 } else { |
| 439 // Close the socket, as it's already accepted. |
| 440 closesocket(buffer->client()); |
| 438 } | 441 } |
| 439 | 442 |
| 440 pending_accept_count_--; | 443 pending_accept_count_--; |
| 441 IOBuffer::DisposeBuffer(buffer); | 444 IOBuffer::DisposeBuffer(buffer); |
| 442 } | 445 } |
| 443 | 446 |
| 444 | 447 |
| 445 void ListenSocket::DoClose() { | 448 void ListenSocket::DoClose() { |
| 446 closesocket(socket()); | 449 closesocket(socket()); |
| 447 handle_ = INVALID_HANDLE_VALUE; | 450 handle_ = INVALID_HANDLE_VALUE; |
| (...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1009 | 1012 |
| 1010 | 1013 |
| 1011 void EventHandlerImplementation::Shutdown() { | 1014 void EventHandlerImplementation::Shutdown() { |
| 1012 SendData(kShutdownId, 0, 0); | 1015 SendData(kShutdownId, 0, 0); |
| 1013 } | 1016 } |
| 1014 | 1017 |
| 1015 } // namespace bin | 1018 } // namespace bin |
| 1016 } // namespace dart | 1019 } // namespace dart |
| 1017 | 1020 |
| 1018 #endif // defined(TARGET_OS_WINDOWS) | 1021 #endif // defined(TARGET_OS_WINDOWS) |
| OLD | NEW |