TsgcTURNServer › Events

TsgcTURNServer Events

Events you can handle, grouped by purpose, followed by the full alphabetical list.

STUN lifecycle

NameDescription
OnSTUNRequestAuthorizationRaised when an authenticated request arrives; supply the password associated with the incoming Username/Realm.
OnSTUNRequestSuccessRaised before the server sends a successful STUN/TURN response so the handler can inspect or veto the reply.
OnSTUNRequestErrorRaised before the server sends a STUN/TURN error response; allows the handler to inspect or suppress the reply.
OnSTUNExceptionRaised when an unhandled exception is caught while parsing or responding to a STUN/TURN message.

Allocations

NameDescription
OnTURNCreateAllocationRaised after a new Allocation has been successfully created for a client.
OnTURNDeleteAllocationRaised after an Allocation has been removed, either by client refresh-to-zero or because its lifetime expired.
OnTURNBeforeAllocateRaised before a new Allocation is created; inspect the relayed IP/port and set Reject to refuse the ALLOCATE request.

Relay

NameDescription
OnTURNBeforeRelayIndicationRaised before the server relays a Send-Indication payload to a peer; set Accept to False to drop the packet.
OnTURNBeforeRelayChannelDataRaised before the server relays a ChannelData payload to a peer; set Accept to False to drop the packet.
OnTURNChannelDataDiscardedRaised when a ChannelData message is dropped because the channel number is invalid or has no permission.
OnTURNMessageDiscardedRaised when a TURN message received by the server is discarded before any response is produced.

All Events (alphabetical)

NameDescription
OnSTUNExceptionRaised when an unhandled exception is caught while parsing or responding to a STUN/TURN message.
OnSTUNRequestAuthorizationRaised when an authenticated request arrives; supply the password associated with the incoming Username/Realm.
OnSTUNRequestErrorRaised before the server sends a STUN/TURN error response; allows the handler to inspect or suppress the reply.
OnSTUNRequestSuccessRaised before the server sends a successful STUN/TURN response so the handler can inspect or veto the reply.
OnTURNBeforeAllocateRaised before a new Allocation is created; inspect the relayed IP/port and set Reject to refuse the ALLOCATE request.
OnTURNBeforeRelayChannelDataRaised before the server relays a ChannelData payload to a peer; set Accept to False to drop the packet.
OnTURNBeforeRelayIndicationRaised before the server relays a Send-Indication payload to a peer; set Accept to False to drop the packet.
OnTURNChannelDataDiscardedRaised when a ChannelData message is dropped because the channel number is invalid or has no permission.
OnTURNCreateAllocationRaised after a new Allocation has been successfully created for a client.
OnTURNDeleteAllocationRaised after an Allocation has been removed, either by client refresh-to-zero or because its lifetime expired.
OnTURNMessageDiscardedRaised when a TURN message received by the server is discarded before any response is produced.