Chromium Code Reviews| 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 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 752 if (how == SD_RECEIVE) MarkClosedRead(); | 752 if (how == SD_RECEIVE) MarkClosedRead(); |
| 753 if (how == SD_SEND) MarkClosedWrite(); | 753 if (how == SD_SEND) MarkClosedWrite(); |
| 754 if (how == SD_BOTH) { | 754 if (how == SD_BOTH) { |
| 755 MarkClosedRead(); | 755 MarkClosedRead(); |
| 756 MarkClosedWrite(); | 756 MarkClosedWrite(); |
| 757 } | 757 } |
| 758 } | 758 } |
| 759 | 759 |
| 760 | 760 |
| 761 void ClientSocket::DoClose() { | 761 void ClientSocket::DoClose() { |
| 762 // Always do a shutdown before initiating a disconnect. | |
| 763 shutdown(socket(), SD_BOTH); | |
|
Søren Gjesse
2014/02/05 11:55:16
This is a long time ago, but as far as I remember
| |
| 764 IssueDisconnect(); | 762 IssueDisconnect(); |
| 765 } | 763 } |
| 766 | 764 |
| 767 | 765 |
| 768 bool ClientSocket::IssueRead() { | 766 bool ClientSocket::IssueRead() { |
| 769 ScopedLock lock(this); | 767 ScopedLock lock(this); |
| 770 ASSERT(completion_port_ != INVALID_HANDLE_VALUE); | 768 ASSERT(completion_port_ != INVALID_HANDLE_VALUE); |
| 771 ASSERT(pending_read_ == NULL); | 769 ASSERT(pending_read_ == NULL); |
| 772 | 770 |
| 773 // TODO(sgjesse): Use a MTU value here. Only the loopback adapter can | 771 // TODO(sgjesse): Use a MTU value here. Only the loopback adapter can |
| (...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1307 | 1305 |
| 1308 | 1306 |
| 1309 void EventHandlerImplementation::Shutdown() { | 1307 void EventHandlerImplementation::Shutdown() { |
| 1310 SendData(kShutdownId, 0, 0); | 1308 SendData(kShutdownId, 0, 0); |
| 1311 } | 1309 } |
| 1312 | 1310 |
| 1313 } // namespace bin | 1311 } // namespace bin |
| 1314 } // namespace dart | 1312 } // namespace dart |
| 1315 | 1313 |
| 1316 #endif // defined(TARGET_OS_WINDOWS) | 1314 #endif // defined(TARGET_OS_WINDOWS) |
| OLD | NEW |