CreatePermission Method

Creates a new permission.

Syntax

public void createPermission(String peerIP);

Remarks

This method creates a new TURN permission for the IP address specified by PeerIP. If a permission with the given IP address already exists, it is refreshed. Permissions can be created and/or refreshed for multiple IP addresses at once by passing a semicolon-separated list of them for the PeerIP parameter.

Permissions expire after 5 minutes unless they are refreshed (this time limit is dictated by the TURN specification and cannot be changed). A permission may be created/refreshed explicitly using this method, or it may be created/refreshed implicitly using the CreateChannel method.

About Permissions

To prevent unwanted messages, TURN servers will only relay packets between a TURN client (e.g., this class) and a peer if there is an active permission for the peer's IP address. This restriction applies to packets flowing in both the peer-to-client direction and the client-to-peer direction, and applies regardless of whether the packets are delivered in an indication or on a channel. Essentially, permissions are a "peer whitelist" mechanism.

The class automatically tracks active permissions, adding and removing items to and from the Permissions collection as they are created and expired. The TURNPermission type's TTL field can be queried to determine the number of seconds remaining until that permission expires.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks P2P 2020 Java Edition - Version 20.0 [Build 8235]