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_CURVECP_CURVECP_SERVER_SOCKET_H_ | 5 #ifndef NET_CURVECP_CURVECP_SERVER_SOCKET_H_ |
6 #define NET_CURVECP_CURVECP_SERVER_SOCKET_H_ | 6 #define NET_CURVECP_CURVECP_SERVER_SOCKET_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "net/base/completion_callback.h" | 10 #include "net/base/completion_callback.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 virtual void OnAccept(CurveCPServerSocket* new_socket) = 0; | 26 virtual void OnAccept(CurveCPServerSocket* new_socket) = 0; |
27 }; | 27 }; |
28 | 28 |
29 CurveCPServerSocket(net::NetLog* net_log, | 29 CurveCPServerSocket(net::NetLog* net_log, |
30 const net::NetLog::Source& source); | 30 const net::NetLog::Source& source); |
31 virtual ~CurveCPServerSocket(); | 31 virtual ~CurveCPServerSocket(); |
32 | 32 |
33 int Listen(const IPEndPoint& endpoint, Acceptor* acceptor); | 33 int Listen(const IPEndPoint& endpoint, Acceptor* acceptor); |
34 void Close(); | 34 void Close(); |
35 | 35 |
36 // Socket methods: | 36 // Socket implementation. |
37 virtual int Read(IOBuffer* buf, | 37 virtual int Read(IOBuffer* buf, |
38 int buf_len, | 38 int buf_len, |
39 OldCompletionCallback* callback) OVERRIDE; | 39 OldCompletionCallback* callback) OVERRIDE; |
| 40 virtual int Read(IOBuffer* buf, |
| 41 int buf_len, |
| 42 const CompletionCallback& callback) OVERRIDE; |
40 virtual int Write(IOBuffer* buf, | 43 virtual int Write(IOBuffer* buf, |
41 int buf_len, | 44 int buf_len, |
42 OldCompletionCallback* callback) OVERRIDE; | 45 OldCompletionCallback* callback) OVERRIDE; |
43 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE; | 46 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE; |
44 virtual bool SetSendBufferSize(int32 size) OVERRIDE; | 47 virtual bool SetSendBufferSize(int32 size) OVERRIDE; |
45 | 48 |
46 // ServerMessenger::Acceptor methods: | 49 // ServerMessenger::Acceptor implementation. |
47 virtual void OnAccept(ConnectionKey key) OVERRIDE; | 50 virtual void OnAccept(ConnectionKey key) OVERRIDE; |
48 | 51 |
49 private: | 52 private: |
50 CurveCPServerSocket(const ConnectionKey& key, | 53 CurveCPServerSocket(const ConnectionKey& key, |
51 ServerPacketizer* packetizer_, | 54 ServerPacketizer* packetizer_, |
52 net::NetLog* net_log, | 55 net::NetLog* net_log, |
53 const net::NetLog::Source& source); | 56 const net::NetLog::Source& source); |
54 ServerMessenger* messenger() { return &messenger_; } | 57 ServerMessenger* messenger() { return &messenger_; } |
55 | 58 |
56 BoundNetLog net_log_; | 59 BoundNetLog net_log_; |
57 scoped_refptr<ServerPacketizer> packetizer_; | 60 scoped_refptr<ServerPacketizer> packetizer_; |
58 ServerMessenger messenger_; | 61 ServerMessenger messenger_; |
59 Acceptor* acceptor_; | 62 Acceptor* acceptor_; |
60 bool is_child_socket_; // Was this socket accepted from another. | 63 bool is_child_socket_; // Was this socket accepted from another. |
61 ConnectionKey key_; | 64 ConnectionKey key_; |
62 | 65 |
63 DISALLOW_COPY_AND_ASSIGN(CurveCPServerSocket); | 66 DISALLOW_COPY_AND_ASSIGN(CurveCPServerSocket); |
64 }; | 67 }; |
65 | 68 |
66 } // namespace net | 69 } // namespace net |
67 | 70 |
68 #endif // NET_CURVECP_CURVECP_SERVER_SOCKET_H_ | 71 #endif // NET_CURVECP_CURVECP_SERVER_SOCKET_H_ |
OLD | NEW |