Open http600 opened 2 years ago
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 Candidate
, holding the same candidateBase.lastSent
, CandidatePair
is running Write
constantly, how can Agent
to sendSTUN
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 @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, We consider any inbound traffic to update timing information
, that's great, RTP is sending constantly, I can see it in wireshark, also I can play it in on web page as mentioned in broadcasting-ion-sfu, so the function of forward is working fine, I will check why constant RTP sending is not keeping alive in the environment, thanks.
client has received DTLSv1.2
with Content Type: Alert (21)
Hi @http600
If you remove the lastReceived/LastSent checks https://github.com/pion/ice/blob/master/agent.go#L701-L702 does it reconnect?
still got disconnected even sending/receiving stun smoothly
Do you always get disconnected? What causes the disconnection?
I'm not sure currently, but the last packet was DTLSV1.2 alert message
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
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.
@Sean-Der
@dafapro / @http600 - did either of you ever figure this out? I'm experiencing a similar issue, connecting a libjuice remote from Pion.
Your environment.
What did you do?
follow here broadcasting-ion-sfu
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 timeout