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

Side by Side Diff: net/socket/tcp_server_socket_win.cc

Issue 11528012: [net] Make IPEndPoint::GetFamily() return AddressFamily and add GetSockAddrFamily() to be used when… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update uses of GetFamily in net/dns/ Created 8 years 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 | « net/socket/tcp_server_socket_libevent.cc ('k') | net/socket/transport_client_socket_pool.cc » ('j') | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/socket/tcp_server_socket_win.h" 5 #include "net/socket/tcp_server_socket_win.h"
6 6
7 #include <mstcpip.h> 7 #include <mstcpip.h>
8 8
9 #include "net/base/ip_endpoint.h" 9 #include "net/base/ip_endpoint.h"
10 #include "net/base/net_errors.h" 10 #include "net/base/net_errors.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 DCHECK_GT(backlog, 0); 46 DCHECK_GT(backlog, 0);
47 DCHECK_EQ(socket_, INVALID_SOCKET); 47 DCHECK_EQ(socket_, INVALID_SOCKET);
48 DCHECK_EQ(socket_event_, WSA_INVALID_EVENT); 48 DCHECK_EQ(socket_event_, WSA_INVALID_EVENT);
49 49
50 socket_event_ = WSACreateEvent(); 50 socket_event_ = WSACreateEvent();
51 if (socket_event_ == WSA_INVALID_EVENT) { 51 if (socket_event_ == WSA_INVALID_EVENT) {
52 PLOG(ERROR) << "WSACreateEvent()"; 52 PLOG(ERROR) << "WSACreateEvent()";
53 return ERR_FAILED; 53 return ERR_FAILED;
54 } 54 }
55 55
56 socket_ = socket(address.GetFamily(), SOCK_STREAM, IPPROTO_TCP); 56 socket_ = socket(address.GetSockAddrFamily(), SOCK_STREAM, IPPROTO_TCP);
57 if (socket_ < 0) { 57 if (socket_ < 0) {
58 PLOG(ERROR) << "socket() returned an error"; 58 PLOG(ERROR) << "socket() returned an error";
59 return MapSystemError(WSAGetLastError()); 59 return MapSystemError(WSAGetLastError());
60 } 60 }
61 61
62 if (SetNonBlocking(socket_)) { 62 if (SetNonBlocking(socket_)) {
63 int result = MapSystemError(WSAGetLastError()); 63 int result = MapSystemError(WSAGetLastError());
64 Close(); 64 Close();
65 return result; 65 return result;
66 } 66 }
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 if (result != ERR_IO_PENDING) { 199 if (result != ERR_IO_PENDING) {
200 accept_socket_ = NULL; 200 accept_socket_ = NULL;
201 CompletionCallback callback = accept_callback_; 201 CompletionCallback callback = accept_callback_;
202 accept_callback_.Reset(); 202 accept_callback_.Reset();
203 callback.Run(result); 203 callback.Run(result);
204 } 204 }
205 } 205 }
206 } 206 }
207 207
208 } // namespace net 208 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/tcp_server_socket_libevent.cc ('k') | net/socket/transport_client_socket_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698