Detailed Description
This structure contains callbacks that will be called by the STUN transport to notify application about various events.
Field Documentation
Notifification when asynchronous send operation has completed.
- Parameters:
-
| stun_sock | The STUN transport. |
| send_key | The send operation key that was given in pj_stun_sock_sendto(). |
| sent | If value is positive non-zero it indicates the number of data sent. When the value is negative, it contains the error code which can be retrieved by negating the value (i.e. status=-sent). |
- Returns:
- Application should normally return PJ_TRUE to let the STUN transport continue its operation. However it must return PJ_FALSE if it has destroyed the STUN transport in this callback.
Notification when incoming packet has been received.
- Parameters:
-
| stun_sock | The STUN transport. |
| data | The packet. |
| data_len | Length of the packet. |
| src_addr | The source address of the packet. |
| addr_len | The length of the source address. |
- Returns:
- Application should normally return PJ_TRUE to let the STUN transport continue its operation. However it must return PJ_FALSE if it has destroyed the STUN transport in this callback.
Notification when the status of the STUN transport has changed. This callback may be called for the following conditions:
- the first time the publicly mapped address has been resolved from the STUN server, this callback will be called with op argument set to PJ_STUN_SOCK_BINDING_OP status argument set to PJ_SUCCESS.
- anytime when the transport has detected that the publicly mapped address has changed, this callback will be called with op argument set to PJ_STUN_SOCK_KEEP_ALIVE_OP and status argument set to PJ_SUCCESS. On this case and the case above, application will get the resolved public address in the pj_stun_sock_info structure.
- for any terminal error (such as STUN time-out, DNS resolution failure, or keep-alive failure), this callback will be called with the status argument set to non-PJ_SUCCESS.
- Parameters:
-
| stun_sock | The STUN transport. |
| op | The operation that triggers the callback. |
| status | The status. |
- Returns:
- Must return PJ_FALSE if it has destroyed the STUN transport in this callback. Application should normally destroy the socket and return PJ_FALSE upon encountering terminal error, otherwise it should return PJ_TRUE to let the STUN socket operation continues.
The documentation for this struct was generated from the following file: