| 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 #include "net/base/ip_endpoint.h" | 5 #include "net/base/ip_endpoint.h" |
| 6 #include "net/base/net_errors.h" | 6 #include "net/base/net_errors.h" |
| 7 #include "net/base/sys_addrinfo.h" | 7 #include "net/base/sys_addrinfo.h" |
| 8 #include "net/curvecp/curvecp_client_socket.h" | 8 #include "net/curvecp/curvecp_client_socket.h" |
| 9 #include "net/curvecp/messenger.h" | 9 #include "net/curvecp/messenger.h" |
| 10 | 10 |
| 11 namespace net { | 11 namespace net { |
| 12 | 12 |
| 13 CurveCPClientSocket::CurveCPClientSocket(const AddressList& addresses, | 13 CurveCPClientSocket::CurveCPClientSocket(const AddressList& addresses, |
| 14 net::NetLog* net_log, | 14 net::NetLog* net_log, |
| 15 const net::NetLog::Source& source) | 15 const net::NetLog::Source& source) |
| 16 : addresses_(addresses), | 16 : addresses_(addresses), |
| 17 net_log_(BoundNetLog::Make(net_log, NetLog::SOURCE_SOCKET)), | 17 net_log_(BoundNetLog::Make(net_log, NetLog::SOURCE_SOCKET)), |
| 18 messenger_(&packetizer_) { | 18 messenger_(&packetizer_) { |
| 19 } | 19 } |
| 20 | 20 |
| 21 CurveCPClientSocket::~CurveCPClientSocket() { | 21 CurveCPClientSocket::~CurveCPClientSocket() { |
| 22 } | 22 } |
| 23 | 23 |
| 24 int CurveCPClientSocket::Connect(OldCompletionCallback* callback) { | 24 int CurveCPClientSocket::Connect(OldCompletionCallback* callback) { |
| 25 return packetizer_.Connect(addresses_, &messenger_, callback); | 25 return packetizer_.Connect(addresses_, &messenger_, callback); |
| 26 } | 26 } |
| 27 | 27 |
| 28 int CurveCPClientSocket::Connect(const net::CompletionCallback& callback) { |
| 29 return packetizer_.Connect(addresses_, &messenger_, callback); |
| 30 } |
| 31 |
| 28 void CurveCPClientSocket::Disconnect() { | 32 void CurveCPClientSocket::Disconnect() { |
| 29 // TODO(mbelshe): DCHECK that we're connected. | 33 // TODO(mbelshe): DCHECK that we're connected. |
| 30 // Record the ConnectionKey so that we can disconnect it properly. | 34 // Record the ConnectionKey so that we can disconnect it properly. |
| 31 // Do we need a close() on the messenger? | 35 // Do we need a close() on the messenger? |
| 32 // packetizer_.Close(); | 36 // packetizer_.Close(); |
| 33 } | 37 } |
| 34 | 38 |
| 35 bool CurveCPClientSocket::IsConnected() const { | 39 bool CurveCPClientSocket::IsConnected() const { |
| 36 // TODO(mbelshe): return packetizer_.IsConnected(); | 40 // TODO(mbelshe): return packetizer_.IsConnected(); |
| 37 return false; | 41 return false; |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 | 114 |
| 111 bool CurveCPClientSocket::SetReceiveBufferSize(int32 size) { | 115 bool CurveCPClientSocket::SetReceiveBufferSize(int32 size) { |
| 112 return true; | 116 return true; |
| 113 } | 117 } |
| 114 | 118 |
| 115 bool CurveCPClientSocket::SetSendBufferSize(int32 size) { | 119 bool CurveCPClientSocket::SetSendBufferSize(int32 size) { |
| 116 return true; | 120 return true; |
| 117 } | 121 } |
| 118 | 122 |
| 119 } // namespace net | 123 } // namespace net |
| OLD | NEW |