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

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

Issue 908873002: Add support to specify the source address for socket connect (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Windows fix Created 5 years, 10 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
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 870 matching lines...) Expand 10 before | Expand all | Expand 10 after
881 port_ = ILLEGAL_PORT; 881 port_ = ILLEGAL_PORT;
882 } 882 }
883 883
884 884
885 void ClientSocket::DisconnectComplete(OverlappedBuffer* buffer) { 885 void ClientSocket::DisconnectComplete(OverlappedBuffer* buffer) {
886 OverlappedBuffer::DisposeBuffer(buffer); 886 OverlappedBuffer::DisposeBuffer(buffer);
887 closesocket(socket()); 887 closesocket(socket());
888 if (data_ready_ != NULL) { 888 if (data_ready_ != NULL) {
889 OverlappedBuffer::DisposeBuffer(data_ready_); 889 OverlappedBuffer::DisposeBuffer(data_ready_);
890 } 890 }
891 closed_ = true; 891 mark_closed();
892 } 892 }
893 893
894 894
895 void ClientSocket::ConnectComplete(OverlappedBuffer* buffer) { 895 void ClientSocket::ConnectComplete(OverlappedBuffer* buffer) {
896 OverlappedBuffer::DisposeBuffer(buffer); 896 OverlappedBuffer::DisposeBuffer(buffer);
897 // Update socket to support full socket API, after ConnectEx completed. 897 // Update socket to support full socket API, after ConnectEx completed.
898 setsockopt(socket(), SOL_SOCKET, SO_UPDATE_CONNECT_CONTEXT, NULL, 0); 898 setsockopt(socket(), SOL_SOCKET, SO_UPDATE_CONNECT_CONTEXT, NULL, 0);
899 Dart_Port p = port(); 899 Dart_Port p = port();
900 if (p != ILLEGAL_PORT) { 900 if (p != ILLEGAL_PORT) {
901 // If the port is set, we already listen for this socket in Dart. 901 // If the port is set, we already listen for this socket in Dart.
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
1380 1380
1381 1381
1382 void EventHandlerImplementation::Shutdown() { 1382 void EventHandlerImplementation::Shutdown() {
1383 SendData(kShutdownId, 0, 0); 1383 SendData(kShutdownId, 0, 0);
1384 } 1384 }
1385 1385
1386 } // namespace bin 1386 } // namespace bin
1387 } // namespace dart 1387 } // namespace dart
1388 1388
1389 #endif // defined(TARGET_OS_WINDOWS) 1389 #endif // defined(TARGET_OS_WINDOWS)
OLDNEW
« no previous file with comments | « runtime/bin/eventhandler_win.h ('k') | runtime/bin/io_natives.cc » ('j') | runtime/bin/socket.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698