ServerObserver
ServerObserver
#include <icy/turn/server/server.h>struct ServerObserverDefined in src/turn/include/icy/turn/server/server.h:96
Observer interface that the application must implement to participate in server-side allocation management and authentication.
The observer is responsible for enforcing per-user allocation quotas and bandwidth limits. Implementations may perform authentication synchronously (returning Authorized/NotAuthorized immediately) or asynchronously (returning Authenticating and calling handleRequest() again later).
List of all members
| Name | Kind | Owner |
|---|---|---|
onServerAllocationCreated | function | Declared here |
onServerAllocationRemoved | function | Declared here |
authenticateRequest | function | Declared here |
Public Methods
| Return | Name | Description |
|---|---|---|
void | onServerAllocationCreated virtual | Called after a new allocation is successfully created. |
void | onServerAllocationRemoved virtual | Called just before an allocation is destroyed (expired, deleted, or server stopped). |
AuthenticationState | authenticateRequest virtual | Authenticates an incoming STUN request using the long-term credential mechanism (RFC 5389 section 10.2). Return Authorized to proceed, NotAuthorized to reject with a 401, QuotaReached to reject with a 486, or Authenticating to defer until the result is available asynchronously. |
onServerAllocationCreated
virtual
virtual void onServerAllocationCreated(Server * server, IAllocation * alloc)Defined in src/turn/include/icy/turn/server/server.h:101
Called after a new allocation is successfully created.
Parameters
serverThe server that owns the allocation.allocThe newly created allocation (lifetime managed by the server).
onServerAllocationRemoved
virtual
virtual void onServerAllocationRemoved(Server * server, IAllocation * alloc)Defined in src/turn/include/icy/turn/server/server.h:106
Called just before an allocation is destroyed (expired, deleted, or server stopped).
Parameters
serverThe server that owned the allocation.allocThe allocation being removed; do not delete this pointer.
authenticateRequest
virtual
virtual AuthenticationState authenticateRequest(Server * server, Request & request)Defined in src/turn/include/icy/turn/server/server.h:115
Authenticates an incoming STUN request using the long-term credential mechanism (RFC 5389 section 10.2). Return Authorized to proceed, NotAuthorized to reject with a 401, QuotaReached to reject with a 486, or Authenticating to defer until the result is available asynchronously.
Parameters
serverThe server receiving the request.requestThe STUN request to authenticate.
Returns
An AuthenticationState indicating how to proceed.
