| /* Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| * Use of this source code is governed by a BSD-style license that can be |
| * found in the LICENSE file. |
| */ |
| |
| /* This is an opaque type holding a network address. */ |
| struct PP_Flash_NetAddress { |
| uint32_t size; |
| [fixed=128] uint8_t data; |
| }; |
| |
| interface PPB_Flash_NetConnector_0_1 { |
| PP_Resource Create( |
| [in] PP_Instance instance_id); |
| PP_Bool IsFlashNetConnector( |
| [in] PP_Resource resource_id); |
| |
| /* Connect to a TCP port given as a host-port pair. The local and remote |
| * addresses of the connection (if successful) are returned in |
| * |local_addr_out| and |remote_addr_out|, respectively, if non-null. |
| */ |
| int32_t ConnectTcp( |
| [in] PP_Resource connector_id, |
| [in] str_t host, |
| [in] uint16_t port, |
| [out] PP_FileHandle socket_out, |
| [out] PP_Flash_NetAddress local_addr_out, |
| [out] PP_Flash_NetAddress remote_addr_out, |
| [in] PP_CompletionCallback callback); |
| |
| /* Same as |ConnectTcp()|, but connecting to the address given by |addr|. A |
| * typical use-case would be for reconnections. |
| */ |
| int32_t ConnectTcpAddress( |
| [in] PP_Resource connector_id, |
| [in] PP_Flash_NetAddress addr, |
| [out] PP_FileHandle socket_out, |
| [out] PP_Flash_NetAddress local_addr_out, |
| [out] PP_Flash_NetAddress remote_addr_out, |
| [in] PP_CompletionCallback callback); |
| }; |