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" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 | 54 |
55 // Sets various socket options. | 55 // Sets various socket options. |
56 // The commonly used options for server listening sockets: | 56 // The commonly used options for server listening sockets: |
57 // - SetAddressReuse(true). | 57 // - SetAddressReuse(true). |
58 int SetDefaultOptionsForServer(); | 58 int SetDefaultOptionsForServer(); |
59 // The commonly used options for client sockets and accepted sockets: | 59 // The commonly used options for client sockets and accepted sockets: |
60 // - SetNoDelay(true); | 60 // - SetNoDelay(true); |
61 // - SetKeepAlive(true, 45). | 61 // - SetKeepAlive(true, 45). |
62 void SetDefaultOptionsForClient(); | 62 void SetDefaultOptionsForClient(); |
63 int SetAddressReuse(bool allow); | 63 int SetAddressReuse(bool allow); |
64 bool SetReceiveBufferSize(int32 size); | 64 int SetReceiveBufferSize(int32 size); |
65 bool SetSendBufferSize(int32 size); | 65 int SetSendBufferSize(int32 size); |
66 bool SetKeepAlive(bool enable, int delay); | 66 bool SetKeepAlive(bool enable, int delay); |
67 bool SetNoDelay(bool no_delay); | 67 bool SetNoDelay(bool no_delay); |
68 | 68 |
69 void Close(); | 69 void Close(); |
70 | 70 |
71 bool UsingTCPFastOpen() const; | 71 bool UsingTCPFastOpen() const; |
72 bool IsValid() const { return socket_ != kInvalidSocket; } | 72 bool IsValid() const { return socket_ != kInvalidSocket; } |
73 | 73 |
74 // Marks the start/end of a series of connect attempts for logging purpose. | 74 // Marks the start/end of a series of connect attempts for logging purpose. |
75 // | 75 // |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 bool logging_multiple_connect_attempts_; | 226 bool logging_multiple_connect_attempts_; |
227 | 227 |
228 BoundNetLog net_log_; | 228 BoundNetLog net_log_; |
229 | 229 |
230 DISALLOW_COPY_AND_ASSIGN(TCPSocketLibevent); | 230 DISALLOW_COPY_AND_ASSIGN(TCPSocketLibevent); |
231 }; | 231 }; |
232 | 232 |
233 } // namespace net | 233 } // namespace net |
234 | 234 |
235 #endif // NET_SOCKET_TCP_SOCKET_LIBEVENT_H_ | 235 #endif // NET_SOCKET_TCP_SOCKET_LIBEVENT_H_ |
OLD | NEW |