IPWorks P2P 2020 Kotlin Edition

Questions / Feedback?

SendData Method

Sends data to a peer using an indication.

Syntax

public fun sendData(peerIP: String?, peerPort: Int, data: ByteArray?)

Remarks

This method sends the specified Data to the peer identified by the specified PeerIP and PeerPort.

Note that there must be an active permission for the given PeerIP, otherwise the server will drop the message. Refer to the CreatePermission method's documentation for more information.

About Data Relaying

There are two mechanisms for sending data between a TURN client (e.g., this component) and a TURN server: indications and channels.

  • Indications work by encapsulating the data within a STUN packet, which allows them to be sent at anytime without any further configuration. Use the SendData method to send data in an indication.
  • Channels must be created ahead-of-time, but allow for more efficient data transfer between the client and server by sending data packets with minimal overhead. Use the SendChannelData method to send data over a channel.
In both cases, the server will only relay data to/from a peer if there is an active permission for the peer's IP address.

Copyright (c) 2021 /n software inc. - All rights reserved.
IPWorks P2P 2020 Kotlin Edition - Version 20.0 [Build 7941]