Class PeerjsConnection
java.lang.Object
nl.colorize.multimedialib.renderer.teavm.PeerjsConnection
- All Implemented Interfaces:
PeerConnection,MessageCallback,org.teavm.jso.JSObject
Implements the
PeerConnection interface in Java, which is then
bridged to the PeerJS implementation in JavaScript via TeaVM.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAttempts to connect to the peer with the specified ID.Returns all received messages from all connected peers that were received since the last time this method was called.voidvoidsendMessage(String message) Sends the specified data message to all connected peers.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.teavm.jso.JSObject
cast
-
Constructor Details
-
PeerjsConnection
-
-
Method Details
-
connect
Description copied from interface:PeerConnectionAttempts 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.- Specified by:
connectin interfacePeerConnection
-
sendMessage
Description copied from interface:PeerConnectionSends the specified data message to all connected peers. The recipients will receive a message of typePeerMessage.TYPE_DATA.- Specified by:
sendMessagein interfacePeerConnection
-
flushReceivedMessages
Description copied from interface:PeerConnectionReturns all received messages from all connected peers that were received since the last time this method was called.- Specified by:
flushReceivedMessagesin interfacePeerConnection
-
onMessage
- Specified by:
onMessagein interfaceMessageCallback
-