use a mock net.PacketConn in tests

This commit is contained in:
Marten Seemann 2020-09-27 14:42:11 +07:00
parent ebe051b2cc
commit a65274942c
9 changed files with 577 additions and 442 deletions

View file

@ -64,7 +64,8 @@ func (m *connMultiplexer) AddConn(
m.mutex.Lock()
defer m.mutex.Unlock()
connIndex := c.LocalAddr().Network() + " " + c.LocalAddr().String()
addr := c.LocalAddr()
connIndex := addr.Network() + " " + addr.String()
p, ok := m.conns[connIndex]
if !ok {
manager, err := m.newPacketHandlerManager(c, connIDLen, statelessResetKey, tracer, m.logger)