| 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_LIBEVENT_H_ | 5 #ifndef NET_SOCKET_TCP_CLIENT_SOCKET_LIBEVENT_H_ |
| 6 #define NET_SOCKET_TCP_CLIENT_SOCKET_LIBEVENT_H_ | 6 #define NET_SOCKET_TCP_CLIENT_SOCKET_LIBEVENT_H_ |
| 7 | 7 |
| 8 #include <sys/socket.h> // for struct sockaddr | 8 #include <sys/socket.h> // for struct sockaddr |
| 9 | 9 |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 virtual int Connect(CompletionCallback* callback); | 32 virtual int Connect(CompletionCallback* callback); |
| 33 virtual void Disconnect(); | 33 virtual void Disconnect(); |
| 34 virtual bool IsConnected() const; | 34 virtual bool IsConnected() const; |
| 35 virtual bool IsConnectedAndIdle() const; | 35 virtual bool IsConnectedAndIdle() const; |
| 36 | 36 |
| 37 // Socket methods: | 37 // Socket methods: |
| 38 // Multiple outstanding requests are not supported. | 38 // Multiple outstanding requests are not supported. |
| 39 // Full duplex mode (reading and writing at the same time) is supported | 39 // Full duplex mode (reading and writing at the same time) is supported |
| 40 virtual int Read(IOBuffer* buf, int buf_len, CompletionCallback* callback); | 40 virtual int Read(IOBuffer* buf, int buf_len, CompletionCallback* callback); |
| 41 virtual int Write(IOBuffer* buf, int buf_len, CompletionCallback* callback); | 41 virtual int Write(IOBuffer* buf, int buf_len, CompletionCallback* callback); |
| 42 virtual bool SetReceiveBufferSize(int32 size); |
| 43 virtual bool SetSendBufferSize(int32 size); |
| 42 | 44 |
| 43 // Identical to posix system call of same name | 45 // Identical to posix system call of same name |
| 44 // Needed by ssl_client_socket_nss | 46 // Needed by ssl_client_socket_nss |
| 45 virtual int GetPeerName(struct sockaddr *name, socklen_t *namelen); | 47 virtual int GetPeerName(struct sockaddr *name, socklen_t *namelen); |
| 46 | 48 |
| 47 private: | 49 private: |
| 48 class ReadWatcher : public MessageLoopForIO::Watcher { | 50 class ReadWatcher : public MessageLoopForIO::Watcher { |
| 49 public: | 51 public: |
| 50 explicit ReadWatcher(TCPClientSocketLibevent* socket) : socket_(socket) {} | 52 explicit ReadWatcher(TCPClientSocketLibevent* socket) : socket_(socket) {} |
| 51 | 53 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 | 128 |
| 127 // External callback; called when write is complete. | 129 // External callback; called when write is complete. |
| 128 CompletionCallback* write_callback_; | 130 CompletionCallback* write_callback_; |
| 129 | 131 |
| 130 DISALLOW_COPY_AND_ASSIGN(TCPClientSocketLibevent); | 132 DISALLOW_COPY_AND_ASSIGN(TCPClientSocketLibevent); |
| 131 }; | 133 }; |
| 132 | 134 |
| 133 } // namespace net | 135 } // namespace net |
| 134 | 136 |
| 135 #endif // NET_SOCKET_TCP_CLIENT_SOCKET_LIBEVENT_H_ | 137 #endif // NET_SOCKET_TCP_CLIENT_SOCKET_LIBEVENT_H_ |
| OLD | NEW |