We are moving to a new platform to serve you better! Stay tuned and watch out for our email on your inbox! [close]
Start a new topic
Answered

lag in signaling peers

 Greetings


I have a fairly simple application in which I need to signal from one peer to another, to trigger other code unrelated to webrtc. I've tried using peerInfo with peerUpdated and sendMessage and incomingMessage. This works but there's a delay of about two seconds, which is too slow... slower than the video lag. Is this delay expected and can you recommend a faster alternative signaling method?


Best Answer
More on this: signaling peers, either by updating peerInfo and catching with the peerUpdated event, or using sendMessage, takes from 1.2 to 1.5 seconds. But if you use sendp2pMessage to a specific peer it takes 50-100 milliseconds. So I've solved my problem by looping through peers and sending them separate messages, rather than "broadcasting" to all peers at once. There seems to be overhead involved when the listeners hear an untargeted event, as if skylink.js must figure out who the peers are before delivery. I've not done much testing with other events, but assume there's a similar delay.
1 Comment

Answer
More on this: signaling peers, either by updating peerInfo and catching with the peerUpdated event, or using sendMessage, takes from 1.2 to 1.5 seconds. But if you use sendp2pMessage to a specific peer it takes 50-100 milliseconds. So I've solved my problem by looping through peers and sending them separate messages, rather than "broadcasting" to all peers at once. There seems to be overhead involved when the listeners hear an untargeted event, as if skylink.js must figure out who the peers are before delivery. I've not done much testing with other events, but assume there's a similar delay.
Login or Signup to post a comment