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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 IPEndPoint* address, | 54 IPEndPoint* address, |
55 const CompletionCallback& callback); | 55 const CompletionCallback& callback); |
56 | 56 |
57 int Connect(const IPEndPoint& address, const CompletionCallback& callback); | 57 int Connect(const IPEndPoint& address, const CompletionCallback& callback); |
58 bool IsConnected() const; | 58 bool IsConnected() const; |
59 bool IsConnectedAndIdle() const; | 59 bool IsConnectedAndIdle() const; |
60 | 60 |
61 // Multiple outstanding requests are not supported. | 61 // Multiple outstanding requests are not supported. |
62 // Full duplex mode (reading and writing at the same time) is supported. | 62 // Full duplex mode (reading and writing at the same time) is supported. |
63 int Read(IOBuffer* buf, int buf_len, const CompletionCallback& callback); | 63 int Read(IOBuffer* buf, int buf_len, const CompletionCallback& callback); |
| 64 int ReadIfReady(IOBuffer* buf, |
| 65 int buf_len, |
| 66 const CompletionCallback& callback); |
64 int Write(IOBuffer* buf, int buf_len, const CompletionCallback& callback); | 67 int Write(IOBuffer* buf, int buf_len, const CompletionCallback& callback); |
65 | 68 |
66 int GetLocalAddress(IPEndPoint* address) const; | 69 int GetLocalAddress(IPEndPoint* address) const; |
67 int GetPeerAddress(IPEndPoint* address) const; | 70 int GetPeerAddress(IPEndPoint* address) const; |
68 | 71 |
69 // Sets various socket options. | 72 // Sets various socket options. |
70 // The commonly used options for server listening sockets: | 73 // The commonly used options for server listening sockets: |
71 // - SetExclusiveAddrUse(). | 74 // - SetExclusiveAddrUse(). |
72 int SetDefaultOptionsForServer(); | 75 int SetDefaultOptionsForServer(); |
73 // The commonly used options for client sockets and accepted sockets: | 76 // The commonly used options for client sockets and accepted sockets: |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 bool logging_multiple_connect_attempts_; | 170 bool logging_multiple_connect_attempts_; |
168 | 171 |
169 NetLogWithSource net_log_; | 172 NetLogWithSource net_log_; |
170 | 173 |
171 DISALLOW_COPY_AND_ASSIGN(TCPSocketWin); | 174 DISALLOW_COPY_AND_ASSIGN(TCPSocketWin); |
172 }; | 175 }; |
173 | 176 |
174 } // namespace net | 177 } // namespace net |
175 | 178 |
176 #endif // NET_SOCKET_TCP_SOCKET_WIN_H_ | 179 #endif // NET_SOCKET_TCP_SOCKET_WIN_H_ |
OLD | NEW |