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 TypeMethodDescriptionvoidAttempts 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.voidsendMessage(String message) Sends the specified data message to all connected peers.
-
Method Details
-
connect
Attempts to connect to the peer with the specified ID. This will lead to a message of typePeerMessage.TYPE_CONNECTor typePeerMessage.TYPE_ERROR, depending on the result. -
sendMessage
Sends the specified data message to all connected peers. The recipients will receive a message of typePeerMessage.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.
-