OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_socket.h" | 5 #include "net/socket/tcp_socket.h" |
6 #include "net/socket/tcp_socket_win.h" | 6 #include "net/socket/tcp_socket_win.h" |
7 | 7 |
8 #include <mstcpip.h> | 8 #include <mstcpip.h> |
9 | 9 |
10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 DCHECK_NE(socket_, INVALID_SOCKET); | 418 DCHECK_NE(socket_, INVALID_SOCKET); |
419 DCHECK(!waiting_connect_); | 419 DCHECK(!waiting_connect_); |
420 | 420 |
421 // |peer_address_| and |core_| will be non-NULL if Connect() has been called. | 421 // |peer_address_| and |core_| will be non-NULL if Connect() has been called. |
422 // Unless Close() is called to reset the internal state, a second call to | 422 // Unless Close() is called to reset the internal state, a second call to |
423 // Connect() is not allowed. | 423 // Connect() is not allowed. |
424 // Please note that we enforce this even if the previous Connect() has | 424 // Please note that we enforce this even if the previous Connect() has |
425 // completed and failed. Although it is allowed to connect the same |socket_| | 425 // completed and failed. Although it is allowed to connect the same |socket_| |
426 // again after a connection attempt failed on Windows, it results in | 426 // again after a connection attempt failed on Windows, it results in |
427 // unspecified behavior according to POSIX. Therefore, we make it behave in | 427 // unspecified behavior according to POSIX. Therefore, we make it behave in |
428 // the same way as TCPSocketLibevent. | 428 // the same way as TCPSocketPosix. |
429 DCHECK(!peer_address_ && !core_.get()); | 429 DCHECK(!peer_address_ && !core_.get()); |
430 | 430 |
431 if (!logging_multiple_connect_attempts_) | 431 if (!logging_multiple_connect_attempts_) |
432 LogConnectBegin(AddressList(address)); | 432 LogConnectBegin(AddressList(address)); |
433 | 433 |
434 peer_address_.reset(new IPEndPoint(address)); | 434 peer_address_.reset(new IPEndPoint(address)); |
435 | 435 |
436 int rv = DoConnect(); | 436 int rv = DoConnect(); |
437 if (rv == ERR_IO_PENDING) { | 437 if (rv == ERR_IO_PENDING) { |
438 // Synchronous operation not supported. | 438 // Synchronous operation not supported. |
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1044 } | 1044 } |
1045 | 1045 |
1046 bool TCPSocketWin::GetEstimatedRoundTripTime(base::TimeDelta* out_rtt) const { | 1046 bool TCPSocketWin::GetEstimatedRoundTripTime(base::TimeDelta* out_rtt) const { |
1047 DCHECK(out_rtt); | 1047 DCHECK(out_rtt); |
1048 // TODO(bmcquade): Consider implementing using | 1048 // TODO(bmcquade): Consider implementing using |
1049 // GetPerTcpConnectionEStats/GetPerTcp6ConnectionEStats. | 1049 // GetPerTcpConnectionEStats/GetPerTcp6ConnectionEStats. |
1050 return false; | 1050 return false; |
1051 } | 1051 } |
1052 | 1052 |
1053 } // namespace net | 1053 } // namespace net |
OLD | NEW |