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

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

Issue 315173003: Mark handle as invalid, when datagram socket is closed. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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 | no next file » | 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 <winsock2.h> // NOLINT 10 #include <winsock2.h> // NOLINT
(...skipping 982 matching lines...) Expand 10 before | Expand all | Expand 10 after
993 bool DatagramSocket::IsClosed() { 993 bool DatagramSocket::IsClosed() {
994 return IsClosing() && !HasPendingRead() && !HasPendingWrite(); 994 return IsClosing() && !HasPendingRead() && !HasPendingWrite();
995 } 995 }
996 996
997 997
998 void DatagramSocket::DoClose() { 998 void DatagramSocket::DoClose() {
999 // Just close the socket. This will cause any queued requests to be aborted. 999 // Just close the socket. This will cause any queued requests to be aborted.
1000 closesocket(socket()); 1000 closesocket(socket());
1001 MarkClosedRead(); 1001 MarkClosedRead();
1002 MarkClosedWrite(); 1002 MarkClosedWrite();
1003 handle_ = INVALID_HANDLE_VALUE;
1003 } 1004 }
1004 1005
1005 1006
1006 void EventHandlerImplementation::HandleInterrupt(InterruptMessage* msg) { 1007 void EventHandlerImplementation::HandleInterrupt(InterruptMessage* msg) {
1007 ASSERT(this != NULL); 1008 ASSERT(this != NULL);
1008 if (msg->id == kTimeoutId) { 1009 if (msg->id == kTimeoutId) {
1009 // Change of timeout request. Just set the new timeout and port as the 1010 // Change of timeout request. Just set the new timeout and port as the
1010 // completion thread will use the new timeout value for its next wait. 1011 // completion thread will use the new timeout value for its next wait.
1011 timeout_queue_.UpdateTimeout(msg->dart_port, msg->data); 1012 timeout_queue_.UpdateTimeout(msg->dart_port, msg->data);
1012 } else if (msg->id == kShutdownId) { 1013 } else if (msg->id == kShutdownId) {
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
1364 1365
1365 1366
1366 void EventHandlerImplementation::Shutdown() { 1367 void EventHandlerImplementation::Shutdown() {
1367 SendData(kShutdownId, 0, 0); 1368 SendData(kShutdownId, 0, 0);
1368 } 1369 }
1369 1370
1370 } // namespace bin 1371 } // namespace bin
1371 } // namespace dart 1372 } // namespace dart
1372 1373
1373 #endif // defined(TARGET_OS_WINDOWS) 1374 #endif // defined(TARGET_OS_WINDOWS)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698