OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef PPAPI_CPP_PRIVATE_FLASH_TCP_SOCKET_H_ | |
6 #define PPAPI_CPP_PRIVATE_FLASH_TCP_SOCKET_H_ | |
7 | |
8 #include "ppapi/c/pp_stdint.h" | |
9 #include "ppapi/c/private/ppb_flash_tcp_socket.h" | |
10 #include "ppapi/cpp/resource.h" | |
11 | |
12 namespace pp { | |
13 | |
14 class CompletionCallback; | |
15 class Instance; | |
16 | |
17 namespace flash { | |
18 | |
19 class TCPSocket : public Resource { | |
20 public: | |
21 explicit TCPSocket(Instance* instance); | |
22 | |
23 // Returns true if the required interface is available. | |
24 static bool IsAvailable(); | |
25 | |
26 int32_t Connect(const char* host, | |
27 uint16_t port, | |
28 const CompletionCallback& callback); | |
29 int32_t ConnectWithNetAddress(const PP_NetAddress_Private* addr, | |
30 const CompletionCallback& callback); | |
31 bool GetLocalAddress(PP_NetAddress_Private* local_addr); | |
32 bool GetRemoteAddress(PP_NetAddress_Private* remote_addr); | |
33 int32_t SSLHandshake(const char* server_name, | |
34 uint16_t server_port, | |
35 const CompletionCallback& callback); | |
36 int32_t Read(char* buffer, | |
37 int32_t bytes_to_read, | |
38 const CompletionCallback& callback); | |
39 int32_t Write(const char* buffer, | |
40 int32_t bytes_to_write, | |
41 const CompletionCallback& callback); | |
42 void Disconnect(); | |
43 }; | |
44 | |
45 } // namespace flash | |
46 } // namespace pp | |
47 | |
48 #endif // PPAPI_CPP_PRIVATE_FLASH_TCP_SOCKET_H_ | |
OLD | NEW |