You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I am trying create webrtc connection between my server and client. For this I have used Pion as turn server. All goes fine I am able to establish the connection and transfer data. However one thing is that there seems to be a pause or hang in call to OnIceCandidate. I suspect something is getting stuck and timing out.
Following is the relevant code:
peerConnection.OnICEGatheringStateChange(func(is webrtc.ICEGathererState) {
fmt.Println(is.String())
})
peerConnection.OnICECandidate(func(i *webrtc.ICECandidate) {
if i == nil {
fmt.Println("All candidates have been gathered")
localDescription := encode(*peerConnection.LocalDescription())
fmt.Println(ANSWER + localDescription)
// do something
} else {
fmt.Printf("Gathered candidate: %s\n", i.String())
}
})
And this is the corresponding output:
2024/08/02 14:27:54 gathering
2024/08/02 14:27:54 Gathered candidate: udp4 host <ip>:45212
2024/08/02 14:27:54 Gathered candidate: udp6 host [<ip>]:35748
2024/08/02 14:27:54 Gathered candidate: udp6 host [<ip>]:47662
2024/08/02 14:27:54 Gathered candidate: udp4 srflx <ip>:8084 related 0.0.0.0:52738
2024/08/02 14:28:02 complete
2024/08/02 14:28:02 All candidates have been gathered
2024/08/02 14:28:02 Answer found to be
As you can see between Gathering of candidate # 4 and complete there is a pause of nearly 8 seconds. Can somebody kindly help me resolve this issue?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I am trying create webrtc connection between my server and client. For this I have used Pion as turn server. All goes fine I am able to establish the connection and transfer data. However one thing is that there seems to be a pause or hang in call to OnIceCandidate. I suspect something is getting stuck and timing out.
Following is the relevant code:
And this is the corresponding output:
As you can see between Gathering of candidate # 4 and complete there is a pause of nearly 8 seconds. Can somebody kindly help me resolve this issue?
Beta Was this translation helpful? Give feedback.
All reactions