update comment for newSession in client

This commit is contained in:
Shelikhoo 2024-09-19 11:57:11 +01:00 committed by WofWca
parent 00da3c95ed
commit de9fede4ac

View file

@ -330,9 +330,12 @@ func parseIceServers(addresses []string) []webrtc.ICEServer {
func newSession(snowflakes SnowflakeCollector) (net.PacketConn, *smux.Session, error) { func newSession(snowflakes SnowflakeCollector) (net.PacketConn, *smux.Session, error) {
// We build a persistent KCP session on a sequence of ephemeral WebRTC // We build a persistent KCP session on a sequence of ephemeral WebRTC
// connections. This dialContext tells RedialPacketConn how to get a new // connections. This dialContext tells RedialPacketConn how to get a new
// WebRTC connection when the previous one dies. Inside each WebRTC // WebRTC connection when the previous one dies.
// connection, we use encapsulationPacketConn to encode packets into a // If Stream based transport are used, inside each WebRTC connection,
// we use encapsulationPacketConn to encode packets into a
// stream. // stream.
// If Packet based transport are used, inside each WebRTC connection,
// packets are sent directly over unreliable data channel.
dialContext := func(ctx context.Context) (net.PacketConn, error) { dialContext := func(ctx context.Context) (net.PacketConn, error) {
log.Printf("redialing on same connection") log.Printf("redialing on same connection")
// Obtain an available WebRTC remote. May block. // Obtain an available WebRTC remote. May block.