telemersive-bus 0.6.7 → 0.6.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/BusClient.js CHANGED
@@ -62,7 +62,7 @@ class BusClient {
62
62
  connectServer = async () => {
63
63
  console.log("connect: attempting to connect to broker...")
64
64
  try{
65
- this.connectTimeout = setTimeout(this.connectionTimeout,1000);
65
+ this.connectTimeout = setTimeout(this.connectionTimeout,4000);
66
66
  await this.communicator.connect();
67
67
  // if connection was successful, subscribe to room info topic
68
68
  await this.communicator.subscribe(new BusMsgSub(this.busTopics.baseRoomInfo('+').build(), this.onRooms, RoomInfo, 2));
package/lib/utils/Peer.js CHANGED
@@ -192,14 +192,16 @@ class Peer {
192
192
  this.updateCallback();
193
193
 
194
194
  // it is important to start the subscription after a successfull joining.
195
+ // important to subscribe to my room ping messages first - otherwise we can run into the problem that we miss
196
+ // the room alive ping while building up the peer list.
197
+ await this.communicator.subscribe(new BusMsgSub(this.busTopics.baseRoomAlive(this.roomName).build(), this.onRoomPing, RoomInfo, 0));
198
+
195
199
  // subscribe to all peer joined messages
196
200
  await this.communicator.subscribe(new BusMsgSub(this.busTopics.roomPeerJoin(this.roomName, '+').build(), this.onPeerJoined, PeerInfo, 2));
197
201
 
198
202
  // subscribe to peer left messages
199
203
  await this.communicator.subscribe(new BusMsgSub(this.busTopics.roomPeerLeft(this.roomName, '+').build(), this.onPeerLeft, PeerInfo, 2));
200
204
 
201
- // subscribe to my room ping messages
202
- await this.communicator.subscribe(new BusMsgSub(this.busTopics.baseRoomAlive(this.roomName).build(), this.onRoomPing, RoomInfo, 0));
203
205
  console.log(" <-- ... local peer subscriptions complete");
204
206
  } else {
205
207
  if(decryptedRoomUuid !== this.roomUuid){
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "telemersive-bus",
3
- "version": "0.6.7",
3
+ "version": "0.6.8",
4
4
  "description": "MQTT based data protocol to manage unlimited peers, connected by rooms, where all peers joined to a room can exchange private data. It provides a simple chat mechanism, latency pinging, publish-subscribe mechanism (based on mqtt) and a OSC-like data stream. ",
5
5
  "main": "index.js",
6
6
  "directories": {