| 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_LIBEVENT_H_ | 5 #ifndef NET_SOCKET_TCP_SOCKET_LIBEVENT_H_ |
| 6 #define NET_SOCKET_TCP_SOCKET_LIBEVENT_H_ | 6 #define NET_SOCKET_TCP_SOCKET_LIBEVENT_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/time/time.h" |
| 12 #include "net/base/address_family.h" | 13 #include "net/base/address_family.h" |
| 13 #include "net/base/completion_callback.h" | 14 #include "net/base/completion_callback.h" |
| 14 #include "net/base/net_export.h" | 15 #include "net/base/net_export.h" |
| 15 #include "net/log/net_log.h" | 16 #include "net/log/net_log.h" |
| 16 | 17 |
| 17 namespace net { | 18 namespace net { |
| 18 | 19 |
| 19 class AddressList; | 20 class AddressList; |
| 20 class IOBuffer; | 21 class IOBuffer; |
| 21 class IPEndPoint; | 22 class IPEndPoint; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 // The commonly used options for client sockets and accepted sockets: | 57 // The commonly used options for client sockets and accepted sockets: |
| 57 // - SetNoDelay(true); | 58 // - SetNoDelay(true); |
| 58 // - SetKeepAlive(true, 45). | 59 // - SetKeepAlive(true, 45). |
| 59 void SetDefaultOptionsForClient(); | 60 void SetDefaultOptionsForClient(); |
| 60 int SetAddressReuse(bool allow); | 61 int SetAddressReuse(bool allow); |
| 61 int SetReceiveBufferSize(int32 size); | 62 int SetReceiveBufferSize(int32 size); |
| 62 int SetSendBufferSize(int32 size); | 63 int SetSendBufferSize(int32 size); |
| 63 bool SetKeepAlive(bool enable, int delay); | 64 bool SetKeepAlive(bool enable, int delay); |
| 64 bool SetNoDelay(bool no_delay); | 65 bool SetNoDelay(bool no_delay); |
| 65 | 66 |
| 67 // Gets the estimated RTT. Returns false if the RTT is |
| 68 // unavailable. May also return false when estimated RTT is 0. |
| 69 bool GetEstimatedRoundTripTime(base::TimeDelta* out_rtt) const |
| 70 WARN_UNUSED_RESULT; |
| 71 |
| 66 void Close(); | 72 void Close(); |
| 67 | 73 |
| 68 // Setter/Getter methods for TCP FastOpen socket option. | 74 // Setter/Getter methods for TCP FastOpen socket option. |
| 69 bool UsingTCPFastOpen() const; | 75 bool UsingTCPFastOpen() const; |
| 70 void EnableTCPFastOpenIfSupported(); | 76 void EnableTCPFastOpenIfSupported(); |
| 71 | 77 |
| 72 bool IsValid() const; | 78 bool IsValid() const; |
| 73 | 79 |
| 74 // Marks the start/end of a series of connect attempts for logging purpose. | 80 // Marks the start/end of a series of connect attempts for logging purpose. |
| 75 // | 81 // |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 bool logging_multiple_connect_attempts_; | 211 bool logging_multiple_connect_attempts_; |
| 206 | 212 |
| 207 BoundNetLog net_log_; | 213 BoundNetLog net_log_; |
| 208 | 214 |
| 209 DISALLOW_COPY_AND_ASSIGN(TCPSocketLibevent); | 215 DISALLOW_COPY_AND_ASSIGN(TCPSocketLibevent); |
| 210 }; | 216 }; |
| 211 | 217 |
| 212 } // namespace net | 218 } // namespace net |
| 213 | 219 |
| 214 #endif // NET_SOCKET_TCP_SOCKET_LIBEVENT_H_ | 220 #endif // NET_SOCKET_TCP_SOCKET_LIBEVENT_H_ |
| OLD | NEW |