Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Side by Side Diff: runtime/bin/eventhandler_win.cc

Issue 19675009: Close 'accepted' sockets when listening socket is closed. Fixes raw_server_socket_cancel_test. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove unused Socket.close, Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/standalone/io/raw_server_socket_cancel_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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)
OLDNEW
« no previous file with comments | « no previous file | tests/standalone/io/raw_server_socket_cancel_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698