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

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

Issue 12209047: Added Socket::Close() function. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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
« no previous file with comments | « runtime/bin/socket_macos.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 "bin/builtin.h" 5 #include "bin/builtin.h"
6 #include "bin/eventhandler.h" 6 #include "bin/eventhandler.h"
7 #include "bin/file.h" 7 #include "bin/file.h"
8 #include "bin/log.h" 8 #include "bin/log.h"
9 #include "bin/socket.h" 9 #include "bin/socket.h"
10 10
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 if (status == SOCKET_ERROR) { 266 if (status == SOCKET_ERROR) {
267 DWORD rc = WSAGetLastError(); 267 DWORD rc = WSAGetLastError();
268 closesocket(s); 268 closesocket(s);
269 SetLastError(rc); 269 SetLastError(rc);
270 return -1; 270 return -1;
271 } 271 }
272 272
273 ListenSocket* listen_socket = new ListenSocket(s); 273 ListenSocket* listen_socket = new ListenSocket(s);
274 return reinterpret_cast<intptr_t>(listen_socket); 274 return reinterpret_cast<intptr_t>(listen_socket);
275 } 275 }
276
277
278 void Socket::Close(intptr_t fd) {
279 ClientSocket* client_socket = reinterpret_cast<ClientSocket*>(fd);
280 client_socket->close();
281 }
OLDNEW
« no previous file with comments | « runtime/bin/socket_macos.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698