fix: mux's udp should add write lock

This commit is contained in:
wwqgtxx
2023-05-11 15:34:28 +08:00
parent 75cd72385a
commit e404695a0d
4 changed files with 29 additions and 19 deletions

View File

@ -92,7 +92,7 @@ func (s *SingMux) ListenPacketContext(ctx context.Context, metadata *C.Metadata,
if pc == nil {
return nil, E.New("packetConn is nil")
}
return newPacketConn(CN.NewRefPacketConn(pc, s), s.ProxyAdapter), nil
return newPacketConn(CN.NewRefPacketConn(CN.NewThreadSafePacketConn(pc), s), s.ProxyAdapter), nil
}
func (s *SingMux) SupportUDP() bool {