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 <stdint.h> |
9 #include <winsock2.h> | 9 #include <winsock2.h> |
10 | 10 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 int Write(IOBuffer* buf, int buf_len, const CompletionCallback& callback); | 62 int Write(IOBuffer* buf, int buf_len, const CompletionCallback& callback); |
63 | 63 |
64 int GetLocalAddress(IPEndPoint* address) const; | 64 int GetLocalAddress(IPEndPoint* address) const; |
65 int GetPeerAddress(IPEndPoint* address) const; | 65 int GetPeerAddress(IPEndPoint* address) const; |
66 | 66 |
67 // Sets various socket options. | 67 // Sets various socket options. |
68 // The commonly used options for server listening sockets: | 68 // The commonly used options for server listening sockets: |
69 // - SetExclusiveAddrUse(). | 69 // - SetExclusiveAddrUse(). |
70 int SetDefaultOptionsForServer(); | 70 int SetDefaultOptionsForServer(); |
71 // The commonly used options for client sockets and accepted sockets: | 71 // The commonly used options for client sockets and accepted sockets: |
72 // - Increase the socket buffer sizes for WinXP; | |
73 // - SetNoDelay(true); | 72 // - SetNoDelay(true); |
74 // - SetKeepAlive(true, 45). | 73 // - SetKeepAlive(true, 45). |
75 void SetDefaultOptionsForClient(); | 74 void SetDefaultOptionsForClient(); |
76 int SetExclusiveAddrUse(); | 75 int SetExclusiveAddrUse(); |
77 int SetReceiveBufferSize(int32_t size); | 76 int SetReceiveBufferSize(int32_t size); |
78 int SetSendBufferSize(int32_t size); | 77 int SetSendBufferSize(int32_t size); |
79 bool SetKeepAlive(bool enable, int delay); | 78 bool SetKeepAlive(bool enable, int delay); |
80 bool SetNoDelay(bool no_delay); | 79 bool SetNoDelay(bool no_delay); |
81 | 80 |
82 // Gets the estimated RTT. Returns false if the RTT is | 81 // Gets the estimated RTT. Returns false if the RTT is |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 bool logging_multiple_connect_attempts_; | 165 bool logging_multiple_connect_attempts_; |
167 | 166 |
168 BoundNetLog net_log_; | 167 BoundNetLog net_log_; |
169 | 168 |
170 DISALLOW_COPY_AND_ASSIGN(TCPSocketWin); | 169 DISALLOW_COPY_AND_ASSIGN(TCPSocketWin); |
171 }; | 170 }; |
172 | 171 |
173 } // namespace net | 172 } // namespace net |
174 | 173 |
175 #endif // NET_SOCKET_TCP_SOCKET_WIN_H_ | 174 #endif // NET_SOCKET_TCP_SOCKET_WIN_H_ |
OLD | NEW |