| 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 <winsock2.h> // NOLINT | 10 #include <winsock2.h> // NOLINT |
| (...skipping 982 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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) |
| OLD | NEW |