| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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_CLIENT_SOCKET_WIN_H_ | 5 #ifndef NET_SOCKET_TCP_CLIENT_SOCKET_WIN_H_ |
| 6 #define NET_SOCKET_TCP_CLIENT_SOCKET_WIN_H_ | 6 #define NET_SOCKET_TCP_CLIENT_SOCKET_WIN_H_ |
| 7 | 7 |
| 8 #include <ws2tcpip.h> | 8 #include <ws2tcpip.h> |
| 9 | 9 |
| 10 #include "base/object_watcher.h" | 10 #include "base/object_watcher.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 virtual void Disconnect(); | 28 virtual void Disconnect(); |
| 29 virtual bool IsConnected() const; | 29 virtual bool IsConnected() const; |
| 30 virtual bool IsConnectedAndIdle() const; | 30 virtual bool IsConnectedAndIdle() const; |
| 31 | 31 |
| 32 // Socket methods: | 32 // Socket methods: |
| 33 // Multiple outstanding requests are not supported. | 33 // Multiple outstanding requests are not supported. |
| 34 // Full duplex mode (reading and writing at the same time) is supported | 34 // Full duplex mode (reading and writing at the same time) is supported |
| 35 virtual int Read(IOBuffer* buf, int buf_len, CompletionCallback* callback); | 35 virtual int Read(IOBuffer* buf, int buf_len, CompletionCallback* callback); |
| 36 virtual int Write(IOBuffer* buf, int buf_len, CompletionCallback* callback); | 36 virtual int Write(IOBuffer* buf, int buf_len, CompletionCallback* callback); |
| 37 | 37 |
| 38 virtual bool SetReceiveBufferSize(int32 size); |
| 39 virtual bool SetSendBufferSize(int32 size); |
| 40 |
| 38 private: | 41 private: |
| 39 class Core; | 42 class Core; |
| 40 | 43 |
| 41 int CreateSocket(const struct addrinfo* ai); | 44 int CreateSocket(const struct addrinfo* ai); |
| 42 void DoReadCallback(int rv); | 45 void DoReadCallback(int rv); |
| 43 void DoWriteCallback(int rv); | 46 void DoWriteCallback(int rv); |
| 44 void DidCompleteConnect(); | 47 void DidCompleteConnect(); |
| 45 void DidCompleteRead(); | 48 void DidCompleteRead(); |
| 46 void DidCompleteWrite(); | 49 void DidCompleteWrite(); |
| 47 | 50 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 68 | 71 |
| 69 // External callback; called when write is complete. | 72 // External callback; called when write is complete. |
| 70 CompletionCallback* write_callback_; | 73 CompletionCallback* write_callback_; |
| 71 | 74 |
| 72 DISALLOW_COPY_AND_ASSIGN(TCPClientSocketWin); | 75 DISALLOW_COPY_AND_ASSIGN(TCPClientSocketWin); |
| 73 }; | 76 }; |
| 74 | 77 |
| 75 } // namespace net | 78 } // namespace net |
| 76 | 79 |
| 77 #endif // NET_SOCKET_TCP_CLIENT_SOCKET_WIN_H_ | 80 #endif // NET_SOCKET_TCP_CLIENT_SOCKET_WIN_H_ |
| OLD | NEW |