| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_SOCKET_H_ | 5 #ifndef NET_SOCKET_SOCKET_H_ |
| 6 #define NET_SOCKET_SOCKET_H_ | 6 #define NET_SOCKET_SOCKET_H_ |
| 7 | 7 |
| 8 #include <stdint.h> |
| 9 |
| 8 #include "net/base/completion_callback.h" | 10 #include "net/base/completion_callback.h" |
| 9 #include "net/base/net_export.h" | 11 #include "net/base/net_export.h" |
| 10 | 12 |
| 11 namespace net { | 13 namespace net { |
| 12 | 14 |
| 13 class IOBuffer; | 15 class IOBuffer; |
| 14 | 16 |
| 15 // Represents a read/write socket. | 17 // Represents a read/write socket. |
| 16 class NET_EXPORT Socket { | 18 class NET_EXPORT Socket { |
| 17 public: | 19 public: |
| (...skipping 24 matching lines...) Expand all Loading... |
| 42 // the provided buffer until the callback is invoked or the socket is | 44 // the provided buffer until the callback is invoked or the socket is |
| 43 // closed. Implementations of this method should not modify the contents | 45 // closed. Implementations of this method should not modify the contents |
| 44 // of the actual buffer that is written to the socket. If the socket is | 46 // of the actual buffer that is written to the socket. If the socket is |
| 45 // Disconnected before the write completes, the callback will not be invoked. | 47 // Disconnected before the write completes, the callback will not be invoked. |
| 46 virtual int Write(IOBuffer* buf, int buf_len, | 48 virtual int Write(IOBuffer* buf, int buf_len, |
| 47 const CompletionCallback& callback) = 0; | 49 const CompletionCallback& callback) = 0; |
| 48 | 50 |
| 49 // Set the receive buffer size (in bytes) for the socket. | 51 // Set the receive buffer size (in bytes) for the socket. |
| 50 // Note: changing this value can affect the TCP window size on some platforms. | 52 // Note: changing this value can affect the TCP window size on some platforms. |
| 51 // Returns a net error code. | 53 // Returns a net error code. |
| 52 virtual int SetReceiveBufferSize(int32 size) = 0; | 54 virtual int SetReceiveBufferSize(int32_t size) = 0; |
| 53 | 55 |
| 54 // Set the send buffer size (in bytes) for the socket. | 56 // Set the send buffer size (in bytes) for the socket. |
| 55 // Note: changing this value can affect the TCP window size on some platforms. | 57 // Note: changing this value can affect the TCP window size on some platforms. |
| 56 // Returns a net error code. | 58 // Returns a net error code. |
| 57 virtual int SetSendBufferSize(int32 size) = 0; | 59 virtual int SetSendBufferSize(int32_t size) = 0; |
| 58 }; | 60 }; |
| 59 | 61 |
| 60 } // namespace net | 62 } // namespace net |
| 61 | 63 |
| 62 #endif // NET_SOCKET_SOCKET_H_ | 64 #endif // NET_SOCKET_SOCKET_H_ |
| OLD | NEW |