| 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 #ifndef NET_SOCKET_TCP_SOCKET_WIN_H_ | 5 #ifndef NET_SOCKET_TCP_SOCKET_WIN_H_ |
| 6 #define NET_SOCKET_TCP_SOCKET_WIN_H_ | 6 #define NET_SOCKET_TCP_SOCKET_WIN_H_ |
| 7 | 7 |
| 8 #include <stdint.h> |
| 8 #include <winsock2.h> | 9 #include <winsock2.h> |
| 9 | 10 |
| 10 #include "base/basictypes.h" | |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/threading/non_thread_safe.h" | 15 #include "base/threading/non_thread_safe.h" |
| 15 #include "base/win/object_watcher.h" | 16 #include "base/win/object_watcher.h" |
| 16 #include "net/base/address_family.h" | 17 #include "net/base/address_family.h" |
| 17 #include "net/base/completion_callback.h" | 18 #include "net/base/completion_callback.h" |
| 18 #include "net/base/net_export.h" | 19 #include "net/base/net_export.h" |
| 19 #include "net/log/net_log.h" | 20 #include "net/log/net_log.h" |
| 20 | 21 |
| 21 namespace net { | 22 namespace net { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 // Sets various socket options. | 62 // Sets various socket options. |
| 62 // The commonly used options for server listening sockets: | 63 // The commonly used options for server listening sockets: |
| 63 // - SetExclusiveAddrUse(). | 64 // - SetExclusiveAddrUse(). |
| 64 int SetDefaultOptionsForServer(); | 65 int SetDefaultOptionsForServer(); |
| 65 // The commonly used options for client sockets and accepted sockets: | 66 // The commonly used options for client sockets and accepted sockets: |
| 66 // - Increase the socket buffer sizes for WinXP; | 67 // - Increase the socket buffer sizes for WinXP; |
| 67 // - SetNoDelay(true); | 68 // - SetNoDelay(true); |
| 68 // - SetKeepAlive(true, 45). | 69 // - SetKeepAlive(true, 45). |
| 69 void SetDefaultOptionsForClient(); | 70 void SetDefaultOptionsForClient(); |
| 70 int SetExclusiveAddrUse(); | 71 int SetExclusiveAddrUse(); |
| 71 int SetReceiveBufferSize(int32 size); | 72 int SetReceiveBufferSize(int32_t size); |
| 72 int SetSendBufferSize(int32 size); | 73 int SetSendBufferSize(int32_t size); |
| 73 bool SetKeepAlive(bool enable, int delay); | 74 bool SetKeepAlive(bool enable, int delay); |
| 74 bool SetNoDelay(bool no_delay); | 75 bool SetNoDelay(bool no_delay); |
| 75 | 76 |
| 76 // Gets the estimated RTT. Returns false if the RTT is | 77 // Gets the estimated RTT. Returns false if the RTT is |
| 77 // unavailable. May also return false when estimated RTT is 0. | 78 // unavailable. May also return false when estimated RTT is 0. |
| 78 bool GetEstimatedRoundTripTime(base::TimeDelta* out_rtt) const | 79 bool GetEstimatedRoundTripTime(base::TimeDelta* out_rtt) const |
| 79 WARN_UNUSED_RESULT; | 80 WARN_UNUSED_RESULT; |
| 80 | 81 |
| 81 void Close(); | 82 void Close(); |
| 82 | 83 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 bool logging_multiple_connect_attempts_; | 160 bool logging_multiple_connect_attempts_; |
| 160 | 161 |
| 161 BoundNetLog net_log_; | 162 BoundNetLog net_log_; |
| 162 | 163 |
| 163 DISALLOW_COPY_AND_ASSIGN(TCPSocketWin); | 164 DISALLOW_COPY_AND_ASSIGN(TCPSocketWin); |
| 164 }; | 165 }; |
| 165 | 166 |
| 166 } // namespace net | 167 } // namespace net |
| 167 | 168 |
| 168 #endif // NET_SOCKET_TCP_SOCKET_WIN_H_ | 169 #endif // NET_SOCKET_TCP_SOCKET_WIN_H_ |
| OLD | NEW |