-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
webrtc client is not sending stun message to keepalive then ice got disconnect #2061
Comments
func (p *CandidatePair) Write(b []byte) (int, error) {
fmt.Printf("CandidatePair Write to %s for %x\n", p.Remote.String(), b)
return p.Local.writeTo(b, p.Remote)
}
func (a *Agent) sendSTUN(msg *stun.Message, local, remote Candidate) {
a.log.Tracef("send STUN message: %s from %s to %s", string(msg.Raw), local.String(), remote.String())
_, err := local.writeTo(msg.Raw, remote)
if err != nil {
a.log.Tracef("failed to send STUN message: %s", err)
}
} just can't get it, they are both writing by the same |
Hi @http600 If you remove the lastReceived/LastSent checks https://github.com/pion/ice/blob/master/agent.go#L701-L702 does it reconnect? Do you always get disconnected? What causes the disconnection? I believe things are correct today. If you are sending RTP/RTCP/DTLS traffic then ICE doesn't need to send keepAlives. We consider any inbound traffic to update timing information here |
Hi @Sean-Der appreciate it very much, |
client has received |
still got disconnected even sending/receiving stun smoothly
I'm not sure currently, but the last packet was DTLSV1.2 alert message
I'm sure it is working, just can not figure it out what is the cause of this problem |
Is there any solution yet? Facing same problem here, connection got disconnected in 2 minutes after sending big file data in data channels. |
Your environment.
What did you do?
go mod init WebRTCCamera
go mod tidy
What did you expect?
What happened?
ICE
connection got disconnectedSTUN
message any more, with help of wiresharkSTUN
message here https://github.com/pion/ice/blob/715f2083100814b24cf1ec213d71178d64d65777/agent.go#L694selectedPair.Local.LastSent()
is not long ago enough, should be longer than 2 secondsLastSent
is keep being not long ago, because it is keep updating at here https://github.com/pion/ice/blob/715f2083100814b24cf1ec213d71178d64d65777/candidate_base.go#L306CandidatePair.Write
is doing too much,candidateBase.lastSent
is keep updating totime.Now()
then https://github.com/pion/ice/blob/715f2083100814b24cf1ec213d71178d64d65777/agent.go#L701 has no chance to sendSTUN
heartbeat message to keep alive, then got disconnected after timeoutThe text was updated successfully, but these errors were encountered: