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

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: Added dart2js patch file 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 #include "bin/eventhandler_win.h" 9 #include "bin/eventhandler_win.h"
10 10
(...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after
868 RemoveAllPorts(); 868 RemoveAllPorts();
869 } 869 }
870 870
871 871
872 void ClientSocket::DisconnectComplete(OverlappedBuffer* buffer) { 872 void ClientSocket::DisconnectComplete(OverlappedBuffer* buffer) {
873 OverlappedBuffer::DisposeBuffer(buffer); 873 OverlappedBuffer::DisposeBuffer(buffer);
874 closesocket(socket()); 874 closesocket(socket());
875 if (data_ready_ != NULL) { 875 if (data_ready_ != NULL) {
876 OverlappedBuffer::DisposeBuffer(data_ready_); 876 OverlappedBuffer::DisposeBuffer(data_ready_);
877 } 877 }
878 closed_ = true; 878 mark_closed();
879 } 879 }
880 880
881 881
882 void ClientSocket::ConnectComplete(OverlappedBuffer* buffer) { 882 void ClientSocket::ConnectComplete(OverlappedBuffer* buffer) {
883 OverlappedBuffer::DisposeBuffer(buffer); 883 OverlappedBuffer::DisposeBuffer(buffer);
884 // Update socket to support full socket API, after ConnectEx completed. 884 // Update socket to support full socket API, after ConnectEx completed.
885 setsockopt(socket(), SOL_SOCKET, SO_UPDATE_CONNECT_CONTEXT, NULL, 0); 885 setsockopt(socket(), SOL_SOCKET, SO_UPDATE_CONNECT_CONTEXT, NULL, 0);
886 // If the port is set, we already listen for this socket in Dart. 886 // If the port is set, we already listen for this socket in Dart.
887 // Handle the cases here. 887 // Handle the cases here.
888 if (!IsClosedRead() && (Mask() & (1 << kInEvent) != 0)) { 888 if (!IsClosedRead() && (Mask() & (1 << kInEvent) != 0)) {
(...skipping 491 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

Powered by Google App Engine
This is Rietveld 408576698