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 "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/ref_counted.h" | 9 #include "base/ref_counted.h" |
10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 // connection. | 26 // connection. |
27 explicit TCPClientSocketLibevent(const AddressList& addresses); | 27 explicit TCPClientSocketLibevent(const AddressList& addresses); |
28 | 28 |
29 virtual ~TCPClientSocketLibevent(); | 29 virtual ~TCPClientSocketLibevent(); |
30 | 30 |
31 // ClientSocket methods: | 31 // ClientSocket methods: |
32 virtual int Connect(CompletionCallback* callback, LoadLog* load_log); | 32 virtual int Connect(CompletionCallback* callback, LoadLog* load_log); |
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 virtual int GetPeerName(struct sockaddr* name, socklen_t* namelen); | 36 virtual int GetPeerAddress(AddressList* address) const; |
37 | 37 |
38 // Socket methods: | 38 // Socket methods: |
39 // Multiple outstanding requests are not supported. | 39 // Multiple outstanding requests are not supported. |
40 // Full duplex mode (reading and writing at the same time) is supported | 40 // Full duplex mode (reading and writing at the same time) is supported |
41 virtual int Read(IOBuffer* buf, int buf_len, CompletionCallback* callback); | 41 virtual int Read(IOBuffer* buf, int buf_len, CompletionCallback* callback); |
42 virtual int Write(IOBuffer* buf, int buf_len, CompletionCallback* callback); | 42 virtual int Write(IOBuffer* buf, int buf_len, CompletionCallback* callback); |
43 virtual bool SetReceiveBufferSize(int32 size); | 43 virtual bool SetReceiveBufferSize(int32 size); |
44 virtual bool SetSendBufferSize(int32 size); | 44 virtual bool SetSendBufferSize(int32 size); |
45 | 45 |
46 private: | 46 private: |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 CompletionCallback* write_callback_; | 130 CompletionCallback* write_callback_; |
131 | 131 |
132 scoped_refptr<LoadLog> load_log_; | 132 scoped_refptr<LoadLog> load_log_; |
133 | 133 |
134 DISALLOW_COPY_AND_ASSIGN(TCPClientSocketLibevent); | 134 DISALLOW_COPY_AND_ASSIGN(TCPClientSocketLibevent); |
135 }; | 135 }; |
136 | 136 |
137 } // namespace net | 137 } // namespace net |
138 | 138 |
139 #endif // NET_SOCKET_TCP_CLIENT_SOCKET_LIBEVENT_H_ | 139 #endif // NET_SOCKET_TCP_CLIENT_SOCKET_LIBEVENT_H_ |
OLD | NEW |