OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_client_socket.h" | 5 #include "net/socket/tcp_client_socket.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "net/base/address_list.h" | 8 #include "net/base/address_list.h" |
9 #include "net/base/host_resolver.h" | 9 #include "net/base/host_resolver.h" |
10 #include "net/base/io_buffer.h" | 10 #include "net/base/io_buffer.h" |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 if (sock) | 112 if (sock) |
113 break; | 113 break; |
114 } | 114 } |
115 ASSERT_TRUE(sock != NULL); | 115 ASSERT_TRUE(sock != NULL); |
116 listen_sock_ = sock; | 116 listen_sock_ = sock; |
117 listen_port_ = port; | 117 listen_port_ = port; |
118 | 118 |
119 AddressList addr; | 119 AddressList addr; |
120 scoped_ptr<HostResolver> resolver( | 120 scoped_ptr<HostResolver> resolver( |
121 CreateSystemHostResolver(HostResolver::kDefaultParallelism, | 121 CreateSystemHostResolver(HostResolver::kDefaultParallelism, |
| 122 HostResolver::kDefaultRetryAttempts, |
122 NULL)); | 123 NULL)); |
123 HostResolver::RequestInfo info(HostPortPair("localhost", listen_port_)); | 124 HostResolver::RequestInfo info(HostPortPair("localhost", listen_port_)); |
124 int rv = resolver->Resolve(info, &addr, NULL, NULL, BoundNetLog()); | 125 int rv = resolver->Resolve(info, &addr, NULL, NULL, BoundNetLog()); |
125 CHECK_EQ(rv, OK); | 126 CHECK_EQ(rv, OK); |
126 sock_.reset( | 127 sock_.reset( |
127 socket_factory_->CreateTransportClientSocket(addr, | 128 socket_factory_->CreateTransportClientSocket(addr, |
128 &net_log_, | 129 &net_log_, |
129 NetLog::Source())); | 130 NetLog::Source())); |
130 } | 131 } |
131 | 132 |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 // Close the server socket, so there will at least be a 0-byte read. | 428 // Close the server socket, so there will at least be a 0-byte read. |
428 CloseServerSocket(); | 429 CloseServerSocket(); |
429 | 430 |
430 rv = callback.WaitForResult(); | 431 rv = callback.WaitForResult(); |
431 EXPECT_GE(rv, 0); | 432 EXPECT_GE(rv, 0); |
432 } | 433 } |
433 | 434 |
434 } // namespace | 435 } // namespace |
435 | 436 |
436 } // namespace net | 437 } // namespace net |
OLD | NEW |