BLOG | DOCUMENTATION | TRAC

Home --> Documentations --> PJNATH Reference

Data Fields

void(* on_rx_data )(pj_turn_sock *turn_sock, void *pkt, unsigned pkt_len, const pj_sockaddr_t *peer_addr, unsigned addr_len)
 
void(* on_state )(pj_turn_sock *turn_sock, pj_turn_state_t old_state, pj_turn_state_t new_state)
 

Detailed Description

This structure contains callbacks that will be called by the TURN transport.

Field Documentation

void(* pj_turn_sock_cb::on_rx_data)(pj_turn_sock *turn_sock, void *pkt, unsigned pkt_len, const pj_sockaddr_t *peer_addr, unsigned addr_len)

Notification when incoming data has been received from the remote peer via the TURN server. The data reported in this callback will be the exact data as sent by the peer (e.g. the TURN encapsulation such as Data Indication or ChannelData will be removed before this function is called).

Parameters
turn_sockThe TURN client transport.
dataThe data as received from the peer.
data_lenLength of the data.
peer_addrThe peer address.
addr_lenThe length of the peer address.
void(* pj_turn_sock_cb::on_state)(pj_turn_sock *turn_sock, pj_turn_state_t old_state, pj_turn_state_t new_state)

Notification when TURN session state has changed. Application should implement this callback to monitor the progress of the TURN session.

Parameters
turn_sockThe TURN client transport.
old_statePrevious state.
new_stateCurrent state.

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

 


PJNATH - Open Source NAT traversal helper library supporting STUN, TURN, and ICE
Copyright (C) 2006-2009 Teluu Inc.