Pepper_31_C_interfaces
Public Attributes | List of all members
PPB_Ext_Socket_Dev_0_2 Struct Reference

#include <ppb_ext_socket_dev.h>

Collaboration diagram for PPB_Ext_Socket_Dev_0_2:
Collaboration graph

Public Attributes

int32_t(* Create )(PP_Instance instance, PP_Ext_Socket_SocketType_Dev type, PP_Ext_Socket_CreateOptions_Dev options, PP_Ext_Socket_CreateInfo_Dev *create_info, struct PP_CompletionCallback callback)
 
void(* Destroy )(PP_Instance instance, struct PP_Var socket_id)
 
int32_t(* Connect )(PP_Instance instance, struct PP_Var socket_id, struct PP_Var hostname, struct PP_Var port, struct PP_Var *result, struct PP_CompletionCallback callback)
 
int32_t(* Bind )(PP_Instance instance, struct PP_Var socket_id, struct PP_Var address, struct PP_Var port, struct PP_Var *result, struct PP_CompletionCallback callback)
 
void(* Disconnect )(PP_Instance instance, struct PP_Var socket_id)
 
int32_t(* Read )(PP_Instance instance, struct PP_Var socket_id, struct PP_Var buffer_size, PP_Ext_Socket_ReadInfo_Dev *read_info, struct PP_CompletionCallback callback)
 
int32_t(* Write )(PP_Instance instance, struct PP_Var socket_id, struct PP_Var data, PP_Ext_Socket_WriteInfo_Dev *write_info, struct PP_CompletionCallback callback)
 
int32_t(* RecvFrom )(PP_Instance instance, struct PP_Var socket_id, struct PP_Var buffer_size, PP_Ext_Socket_RecvFromInfo_Dev *recv_from_info, struct PP_CompletionCallback callback)
 
int32_t(* SendTo )(PP_Instance instance, struct PP_Var socket_id, struct PP_Var data, struct PP_Var address, struct PP_Var port, PP_Ext_Socket_WriteInfo_Dev *write_info, struct PP_CompletionCallback callback)
 
int32_t(* Listen )(PP_Instance instance, struct PP_Var socket_id, struct PP_Var address, struct PP_Var port, struct PP_Var backlog, struct PP_Var *result, struct PP_CompletionCallback callback)
 
int32_t(* Accept )(PP_Instance instance, struct PP_Var socket_id, PP_Ext_Socket_AcceptInfo_Dev *accept_info, struct PP_CompletionCallback callback)
 
int32_t(* SetKeepAlive )(PP_Instance instance, struct PP_Var socket_id, struct PP_Var enable, struct PP_Var delay, struct PP_Var *result, struct PP_CompletionCallback callback)
 
int32_t(* SetNoDelay )(PP_Instance instance, struct PP_Var socket_id, struct PP_Var no_delay, struct PP_Var *result, struct PP_CompletionCallback callback)
 
int32_t(* GetInfo )(PP_Instance instance, struct PP_Var socket_id, PP_Ext_Socket_SocketInfo_Dev *result, struct PP_CompletionCallback callback)
 
int32_t(* GetNetworkList )(PP_Instance instance, PP_Ext_Socket_NetworkInterface_Dev_Array *result, struct PP_CompletionCallback callback)
 
int32_t(* JoinGroup )(PP_Instance instance, struct PP_Var socket_id, struct PP_Var address, struct PP_Var *result, struct PP_CompletionCallback callback)
 
int32_t(* LeaveGroup )(PP_Instance instance, struct PP_Var socket_id, struct PP_Var address, struct PP_Var *result, struct PP_CompletionCallback callback)
 
int32_t(* SetMulticastTimeToLive )(PP_Instance instance, struct PP_Var socket_id, struct PP_Var ttl, struct PP_Var *result, struct PP_CompletionCallback callback)
 
int32_t(* SetMulticastLoopbackMode )(PP_Instance instance, struct PP_Var socket_id, struct PP_Var enabled, struct PP_Var *result, struct PP_CompletionCallback callback)
 
int32_t(* GetJoinedGroups )(PP_Instance instance, struct PP_Var socket_id, struct PP_Var *groups, struct PP_CompletionCallback callback)
 

Detailed Description

Definition at line 141 of file ppb_ext_socket_dev.h.

Member Data Documentation

int32_t(* PPB_Ext_Socket_Dev_0_2::Accept)(PP_Instance instance, struct PP_Var socket_id, PP_Ext_Socket_AcceptInfo_Dev *accept_info, struct PP_CompletionCallback callback)

This method applies to TCP sockets only. Registers a callback function to be called when a connection is accepted on this listening server socket. Listen must be called first. If there is already an active accept callback, this callback will be invoked immediately with an error as the resultCode.

Parameters
[in]instanceA PP_Instance.
[in]socket_idAn integer PP_Var. The socket ID.
[out]accept_infoA PP_Ext_Socket_AcceptInfo_Dev.
[in]callbackA PP_CompletionCallback to be called upon completion.
Returns
An error code from pp_errors.h.

Definition at line 341 of file ppb_ext_socket_dev.h.

int32_t(* PPB_Ext_Socket_Dev_0_2::Bind)(PP_Instance instance, struct PP_Var socket_id, struct PP_Var address, struct PP_Var port, struct PP_Var *result, struct PP_CompletionCallback callback)

Binds the local address for socket. Currently, it does not support TCP socket.

Parameters
[in]instanceA PP_Instance.
[in]socket_idAn integer PP_Var. The socket ID.
[in]addressA string PP_Var. The address of the local machine.
[in]portAn integer PP_Var. The port of the local machine.
[out]resultAn integer PP_Var.
[in]callbackA PP_CompletionCallback to be called upon completion.
Returns
An error code from pp_errors.h.

Definition at line 209 of file ppb_ext_socket_dev.h.

int32_t(* PPB_Ext_Socket_Dev_0_2::Connect)(PP_Instance instance, struct PP_Var socket_id, struct PP_Var hostname, struct PP_Var port, struct PP_Var *result, struct PP_CompletionCallback callback)

Connects the socket to the remote machine (for a tcp socket). For a udp socket, this sets the default address which packets are sent to and read from for Read() and Write() calls.

Parameters
[in]instanceA PP_Instance.
[in]socket_idAn integer PP_Var. The socket ID.
[in]hostnameA string PP_Var. The hostname or IP address of the remote machine.
[in]portAn integer PP_Var. The port of the remote machine.
[out]resultAn integer PP_Var.
[in]callbackA PP_CompletionCallback to be called upon completion.
Returns
An error code from pp_errors.h.

Definition at line 187 of file ppb_ext_socket_dev.h.

int32_t(* PPB_Ext_Socket_Dev_0_2::Create)(PP_Instance instance, PP_Ext_Socket_SocketType_Dev type, PP_Ext_Socket_CreateOptions_Dev options, PP_Ext_Socket_CreateInfo_Dev *create_info, struct PP_CompletionCallback callback)

Creates a socket of the specified type that will connect to the specified remote machine.

Parameters
[in]instanceA PP_Instance.
[in]typeA PP_Ext_Socket_SocketType_Dev. The type of socket to create. Must be tcp or udp.
[in]optionsAn undefined PP_Var or PP_Ext_Socket_CreateOptions_Dev. The socket options.
[out]create_infoA PP_Ext_Socket_CreateInfo_Dev.
[in]callbackA PP_CompletionCallback to be called upon completion.
Returns
An error code from pp_errors.h.

Definition at line 157 of file ppb_ext_socket_dev.h.

void(* PPB_Ext_Socket_Dev_0_2::Destroy)(PP_Instance instance, struct PP_Var socket_id)

Destroys the socket. Each socket created should be destroyed after use.

Parameters
[in]instanceA PP_Instance.
[in]socket_idAn integer PP_Var. The socket ID.

Definition at line 168 of file ppb_ext_socket_dev.h.

void(* PPB_Ext_Socket_Dev_0_2::Disconnect)(PP_Instance instance, struct PP_Var socket_id)

Disconnects the socket. For UDP sockets, Disconnect is a non-operation but is safe to call.

Parameters
[in]instanceA PP_Instance.
[in]socket_idAn integer PP_Var. The socket ID.

Definition at line 222 of file ppb_ext_socket_dev.h.

int32_t(* PPB_Ext_Socket_Dev_0_2::GetInfo)(PP_Instance instance, struct PP_Var socket_id, PP_Ext_Socket_SocketInfo_Dev *result, struct PP_CompletionCallback callback)

Retrieves the state of the given socket.

Parameters
[in]instanceA PP_Instance.
[in]socket_idAn integer PP_Var. The socket ID.
[out]resultA PP_Ext_Socket_SocketInfo_Dev.
[in]callbackA PP_CompletionCallback to be called upon completion.
Returns
An error code from pp_errors.h.

Definition at line 396 of file ppb_ext_socket_dev.h.

int32_t(* PPB_Ext_Socket_Dev_0_2::GetJoinedGroups)(PP_Instance instance, struct PP_Var socket_id, struct PP_Var *groups, struct PP_CompletionCallback callback)

Gets the multicast group addresses the socket is currently joined to.

Parameters
[in]instanceA PP_Instance.
[in]socket_idAn integer PP_Var. The socket ID.
[out]groupsAn array PP_Var of string PP_Vars.
[in]callbackA PP_CompletionCallback to be called upon completion.
Returns
An error code from pp_errors.h.

Definition at line 518 of file ppb_ext_socket_dev.h.

int32_t(* PPB_Ext_Socket_Dev_0_2::GetNetworkList)(PP_Instance instance, PP_Ext_Socket_NetworkInterface_Dev_Array *result, struct PP_CompletionCallback callback)

Retrieves information about local adapters on this system.

Parameters
[in]instanceA PP_Instance.
[out]resultA PP_Ext_Socket_NetworkInterface_Dev_Array.
[in]callbackA PP_CompletionCallback to be called upon completion.
Returns
An error code from pp_errors.h.

Definition at line 410 of file ppb_ext_socket_dev.h.

int32_t(* PPB_Ext_Socket_Dev_0_2::JoinGroup)(PP_Instance instance, struct PP_Var socket_id, struct PP_Var address, struct PP_Var *result, struct PP_CompletionCallback callback)

Joins the multicast group and starts to receive packets from that group. The socket must be of UDP type and must be bound to a local port before calling this method.

Parameters
[in]instanceA PP_Instance.
[in]socket_idAn integer PP_Var. The socket ID.
[in]addressA string PP_Var. The group address to join. Domain names are not supported.
[out]resultAn integer PP_Var.
[in]callbackA PP_CompletionCallback to be called upon completion.
Returns
An error code from pp_errors.h.

Definition at line 428 of file ppb_ext_socket_dev.h.

int32_t(* PPB_Ext_Socket_Dev_0_2::LeaveGroup)(PP_Instance instance, struct PP_Var socket_id, struct PP_Var address, struct PP_Var *result, struct PP_CompletionCallback callback)

Leaves the multicast group previously joined using JoinGroup. It's not necessary to leave the multicast group before destroying the socket or exiting. This is automatically called by the OS.

Leaving the group will prevent the router from sending multicast datagrams to the local host, presuming no other process on the host is still joined to the group.

Parameters
[in]instanceA PP_Instance.
[in]socket_idAn integer PP_Var. The socket ID.
[in]addressA string PP_Var. The group address to leave. Domain names are not supported.
[out]resultAn integer PP_Var.
[in]callbackA PP_CompletionCallback to be called upon completion.
Returns
An error code from pp_errors.h.

Definition at line 452 of file ppb_ext_socket_dev.h.

int32_t(* PPB_Ext_Socket_Dev_0_2::Listen)(PP_Instance instance, struct PP_Var socket_id, struct PP_Var address, struct PP_Var port, struct PP_Var backlog, struct PP_Var *result, struct PP_CompletionCallback callback)

This method applies to TCP sockets only. Listens for connections on the specified port and address. This effectively makes this a server socket, and client socket functions (Connect, Read, Write) can no longer be used on this socket.

Parameters
[in]instanceA PP_Instance.
[in]socket_idAn integer PP_Var. The socket ID.
[in]addressA string PP_Var. The address of the local machine.
[in]portAn integer PP_Var. The port of the local machine.
[in]backlogAn undefined or integer PP_Var. Length of the socket's listen queue.
[out]resultAn integer PP_Var.
[in]callbackA PP_CompletionCallback to be called upon completion.
Returns
An error code from pp_errors.h.

Definition at line 319 of file ppb_ext_socket_dev.h.

int32_t(* PPB_Ext_Socket_Dev_0_2::Read)(PP_Instance instance, struct PP_Var socket_id, struct PP_Var buffer_size, PP_Ext_Socket_ReadInfo_Dev *read_info, struct PP_CompletionCallback callback)

Reads data from the given connected socket.

Parameters
[in]instanceA PP_Instance.
[in]socket_idAn integer PP_Var. The socket ID.
[in]buffer_sizeAn undefined or integer PP_Var. The read buffer size.
[out]read_infoA PP_Ext_Socket_ReadInfo_Dev.
[in]callbackA PP_CompletionCallback to be called upon completion.
Returns
An error code from pp_errors.h.

Definition at line 236 of file ppb_ext_socket_dev.h.

int32_t(* PPB_Ext_Socket_Dev_0_2::RecvFrom)(PP_Instance instance, struct PP_Var socket_id, struct PP_Var buffer_size, PP_Ext_Socket_RecvFromInfo_Dev *recv_from_info, struct PP_CompletionCallback callback)

Receives data from the given UDP socket.

Parameters
[in]instanceA PP_Instance.
[in]socket_idAn integer PP_Var. The socket ID.
[in]buffer_sizeAn undefined or integer PP_Var. The receive buffer size.
[out]recv_from_infoA PP_Ext_Socket_RecvFromInfo_Dev.
[in]callbackA PP_CompletionCallback to be called upon completion.
Returns
An error code from pp_errors.h.

Definition at line 271 of file ppb_ext_socket_dev.h.

int32_t(* PPB_Ext_Socket_Dev_0_2::SendTo)(PP_Instance instance, struct PP_Var socket_id, struct PP_Var data, struct PP_Var address, struct PP_Var port, PP_Ext_Socket_WriteInfo_Dev *write_info, struct PP_CompletionCallback callback)

Sends data on the given UDP socket to the given address and port.

Parameters
[in]instanceA PP_Instance.
[in]socket_idAn integer PP_Var. The socket ID.
[in]dataAn array buffer PP_Var.
[in]addressA string PP_Var. The address of the remote machine.
[in]portAn integer PP_Var. The port of the remote machine.
[out]write_infoA PP_Ext_Socket_WriteInfo_Dev.
[in]callbackA PP_CompletionCallback to be called upon completion.
Returns
An error code from pp_errors.h.

Definition at line 292 of file ppb_ext_socket_dev.h.

int32_t(* PPB_Ext_Socket_Dev_0_2::SetKeepAlive)(PP_Instance instance, struct PP_Var socket_id, struct PP_Var enable, struct PP_Var delay, struct PP_Var *result, struct PP_CompletionCallback callback)

Enables or disables the keep-alive functionality for a TCP connection.

Parameters
[in]instanceA PP_Instance.
[in]socket_idAn integer PP_Var. The socket ID.
[in]enableA boolean PP_Var. If true, enable keep-alive functionality.
[in]delayAn undefined or integer PP_Var. Set the delay seconds between the last data packet received and the first keepalive probe. Default is 0.
[out]resultA boolean PP_Var.
[in]callbackA PP_CompletionCallback to be called upon completion.
Returns
An error code from pp_errors.h.

Definition at line 361 of file ppb_ext_socket_dev.h.

int32_t(* PPB_Ext_Socket_Dev_0_2::SetMulticastLoopbackMode)(PP_Instance instance, struct PP_Var socket_id, struct PP_Var enabled, struct PP_Var *result, struct PP_CompletionCallback callback)

Sets whether multicast packets sent from the host to the multicast group will be looped back to the host.

Note: the behavior of SetMulticastLoopbackMode is slightly different between Windows and Unix-like systems. The inconsistency happens only when there is more than one application on the same host joined to the same multicast group while having different settings on multicast loopback mode. On Windows, the applications with loopback off will not RECEIVE the loopback packets; while on Unix-like systems, the applications with loopback off will not SEND the loopback packets to other applications on the same host. See MSDN: http://goo.gl/6vqbj

Calling this method does not require multicast permissions.

Parameters
[in]instanceA PP_Instance.
[in]socket_idAn integer PP_Var. The socket ID.
[in]enabledA boolean PP_Var. Indicates whether to enable loopback mode.
[out]resultAn integer PP_Var.
[in]callbackA PP_CompletionCallback to be called upon completion.
Returns
An error code from pp_errors.h.

Definition at line 501 of file ppb_ext_socket_dev.h.

int32_t(* PPB_Ext_Socket_Dev_0_2::SetMulticastTimeToLive)(PP_Instance instance, struct PP_Var socket_id, struct PP_Var ttl, struct PP_Var *result, struct PP_CompletionCallback callback)

Sets the time-to-live of multicast packets sent to the multicast group.

Calling this method does not require multicast permissions.

Parameters
[in]instanceA PP_Instance.
[in]socket_idAn integer PP_Var. The socket ID.
[in]ttlAn integer PP_Var. The time-to-live value.
[out]resultAn integer PP_Var.
[in]callbackA PP_CompletionCallback to be called upon completion.
Returns
An error code from pp_errors.h.

Definition at line 471 of file ppb_ext_socket_dev.h.

int32_t(* PPB_Ext_Socket_Dev_0_2::SetNoDelay)(PP_Instance instance, struct PP_Var socket_id, struct PP_Var no_delay, struct PP_Var *result, struct PP_CompletionCallback callback)

Sets or clears TCP_NODELAY for a TCP connection. Nagle's algorithm will be disabled when TCP_NODELAY is set.

Parameters
[in]instanceA PP_Instance.
[in]socket_idAn integer PP_Var. The socket ID.
[in]no_delayA boolean PP_Var.
[out]resultA boolean PP_Var.
[in]callbackA PP_CompletionCallback to be called upon completion.
Returns
An error code from pp_errors.h.

Definition at line 380 of file ppb_ext_socket_dev.h.

int32_t(* PPB_Ext_Socket_Dev_0_2::Write)(PP_Instance instance, struct PP_Var socket_id, struct PP_Var data, PP_Ext_Socket_WriteInfo_Dev *write_info, struct PP_CompletionCallback callback)

Writes data on the given connected socket.

Parameters
[in]instanceA PP_Instance.
[in]socket_idAn integer PP_Var. The socket ID.
[in]dataAn array buffer PP_Var. The data to write.
[out]write_infoA PP_Ext_Socket_WriteInfo_Dev.
[in]callbackA PP_CompletionCallback to be called upon completion.
Returns
An error code from pp_errors.h.

Definition at line 253 of file ppb_ext_socket_dev.h.


The documentation for this struct was generated from the following file: