Class: PeerJsConnector
Defined in: | lib/Connectors/PeerJsConnector.coffee |
Overview
PeerJs is a Framework that enables you to connect to other peers. You just need the user-id of the peer (browser/client). And then you can connect to it.
Instance Method Summary
- # (void) connectToPeer(id) Connect the Framework to another peer.
- # (Array<String>) getAllConnectionIds() Receive the id of every connected peer.
- # (void) addConnection(conn) Adds an existing connection to this connector.
Constructor Details
#
(void)
constructor(engine, HB, execution_listener, yatta)
Instance Method Details
#
(void)
connectToPeer(id)
Connect the Framework to another peer. Therefore you have to receive his user_id. If the other peer is connected to other peers, the PeerJsConnector will automatically connect to them too.
Transmitting the user_id is your job. See TextEditing for a nice example on how to do that with urls.
#
(Array<String>)
getAllConnectionIds()
Receive the id of every connected peer.
#
(void)
addConnection(conn)
Adds an existing connection to this connector.