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

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

Issue 15904013: Fix windows build (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | « runtime/bin/dartutils.cc ('k') | 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/builtin.h" 8 #include "bin/builtin.h"
9 #include "bin/eventhandler.h" 9 #include "bin/eventhandler.h"
10 #include "bin/file.h" 10 #include "bin/file.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 ClientSocket* client_socket = new ClientSocket(s); 135 ClientSocket* client_socket = new ClientSocket(s);
136 return reinterpret_cast<intptr_t>(client_socket); 136 return reinterpret_cast<intptr_t>(client_socket);
137 } 137 }
138 138
139 139
140 intptr_t Socket::Connect(intptr_t fd, RawAddr addr, const intptr_t port) { 140 intptr_t Socket::Connect(intptr_t fd, RawAddr addr, const intptr_t port) {
141 ASSERT(reinterpret_cast<Handle*>(fd)->is_socket()); 141 ASSERT(reinterpret_cast<Handle*>(fd)->is_socket());
142 SocketHandle* handle = reinterpret_cast<SocketHandle*>(fd); 142 SocketHandle* handle = reinterpret_cast<SocketHandle*>(fd);
143 SOCKET s = handle->socket(); 143 SOCKET s = handle->socket();
144 SocketAddress::SetAddrPort(&addr, port); 144 SocketAddress::SetAddrPort(&addr, port);
145 status = connect( 145 int status = connect(s, &addr.addr, SocketAddress::GetAddrLength(addr));
146 s,
147 &addr.addr,
148 SocketAddress::GetAddrLength(addr));
149 if (status == SOCKET_ERROR) { 146 if (status == SOCKET_ERROR) {
150 DWORD rc = WSAGetLastError(); 147 DWORD rc = WSAGetLastError();
151 handle->close(); 148 ClientSocket* client_socket = reinterpret_cast<ClientSocket*>(fd);
149 client_socket->Close();
152 SetLastError(rc); 150 SetLastError(rc);
153 return -1; 151 return -1;
154 } 152 }
155 return fd; 153 return fd;
156 } 154 }
157 155
158 156
159 intptr_t Socket::CreateConnect(RawAddr addr, const intptr_t port) { 157 intptr_t Socket::CreateConnect(RawAddr addr, const intptr_t port) {
160 intptr_t fd = Socket::Create(addr); 158 intptr_t fd = Socket::Create(addr);
161 if (fd < 0) { 159 if (fd < 0) {
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 IPPROTO_TCP, 344 IPPROTO_TCP,
347 TCP_NODELAY, 345 TCP_NODELAY,
348 reinterpret_cast<char *>(&on), 346 reinterpret_cast<char *>(&on),
349 sizeof(on)) == 0; 347 sizeof(on)) == 0;
350 } 348 }
351 349
352 } // namespace bin 350 } // namespace bin
353 } // namespace dart 351 } // namespace dart
354 352
355 #endif // defined(TARGET_OS_WINDOWS) 353 #endif // defined(TARGET_OS_WINDOWS)
OLDNEW
« no previous file with comments | « runtime/bin/dartutils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698