OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef PPAPI_CPP_PRIVATE_TCP_SOCKET_PRIVATE_H_ |
| 6 #define PPAPI_CPP_PRIVATE_TCP_SOCKET_PRIVATE_H_ |
| 7 |
| 8 #include "ppapi/cpp/pass_ref.h" |
| 9 #include "ppapi/cpp/resource.h" |
| 10 #include "ppapi/c/pp_stdint.h" |
| 11 #include "ppapi/c/private/ppb_tcp_socket_private.h" |
| 12 |
| 13 namespace pp { |
| 14 |
| 15 class CompletionCallback; |
| 16 class InstanceHandle; |
| 17 |
| 18 class TCPSocketPrivate : public Resource { |
| 19 public: |
| 20 explicit TCPSocketPrivate(const InstanceHandle& instance); |
| 21 |
| 22 TCPSocketPrivate(PassRef, PP_Resource resource); |
| 23 |
| 24 // Returns true if the required interface is available. |
| 25 static bool IsAvailable(); |
| 26 |
| 27 int32_t Connect(const char* host, |
| 28 uint16_t port, |
| 29 const CompletionCallback& callback); |
| 30 int32_t ConnectWithNetAddress(const PP_NetAddress_Private* addr, |
| 31 const CompletionCallback& callback); |
| 32 bool GetLocalAddress(PP_NetAddress_Private* local_addr); |
| 33 bool GetRemoteAddress(PP_NetAddress_Private* remote_addr); |
| 34 int32_t SSLHandshake(const char* server_name, |
| 35 uint16_t server_port, |
| 36 const CompletionCallback& callback); |
| 37 int32_t Read(char* buffer, |
| 38 int32_t bytes_to_read, |
| 39 const CompletionCallback& callback); |
| 40 int32_t Write(const char* buffer, |
| 41 int32_t bytes_to_write, |
| 42 const CompletionCallback& callback); |
| 43 void Disconnect(); |
| 44 }; |
| 45 |
| 46 } // namespace pp |
| 47 |
| 48 #endif // PPAPI_CPP_PRIVATE_TCP_SOCKET_PRIVATE_H_ |
| 49 |
OLD | NEW |