Interface PeerConnection


public interface PeerConnection
Access to a currently active peer-to-peer connection, which can be obtained from Network. The protocol used for the connection depends on both the renderer and the current platform. The same PeerConnection instance can be connected to multiple peers.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    connect(String peerId)
    Attempts to connect to the peer with the specified ID.
    Iterable<nl.colorize.multimedialib.renderer.teavm.PeerMessage>
    Returns all received messages from all connected peers that were received since the last time this method was called.
    void
    Sends the specified data message to all connected peers.
  • Method Details

    • connect

      void connect(String peerId)
      Attempts to connect to the peer with the specified ID. This will lead to a message of type PeerMessage.TYPE_CONNECT or type PeerMessage.TYPE_ERROR, depending on the result.
    • sendMessage

      void sendMessage(String message)
      Sends the specified data message to all connected peers. The recipients will receive a message of type PeerMessage.TYPE_DATA.
    • flushReceivedMessages

      Iterable<nl.colorize.multimedialib.renderer.teavm.PeerMessage> flushReceivedMessages()
      Returns all received messages from all connected peers that were received since the last time this method was called.