BLOG | DOCUMENTATION | TRAC

Home --> Documentations --> PJNATH Reference

pj_turn_sock_cb Struct Reference
[TURN client transport]

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_sock The TURN client transport.
data The data as received from the peer.
data_len Length of the data.
peer_addr The peer address.
addr_len The 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_sock The TURN client transport.
old_state Previous state.
new_state Current 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.