multiplex multiple clients on one packet conn

This commit is contained in:
Marten Seemann 2018-05-22 11:08:48 +08:00
parent dacc94ccba
commit 2c05dbff07
9 changed files with 259 additions and 27 deletions

View file

@ -1,6 +1,7 @@
package quic
import (
"errors"
"time"
"github.com/lucas-clemente/quic-go/internal/protocol"
@ -45,12 +46,13 @@ var _ = Describe("Packet Handler Map", func() {
})
It("closes", func() {
testErr := errors.New("test error")
sess1 := NewMockQuicSession(mockCtrl)
sess1.EXPECT().Close(nil)
sess1.EXPECT().Close(testErr)
sess2 := NewMockQuicSession(mockCtrl)
sess2.EXPECT().Close(nil)
sess2.EXPECT().Close(testErr)
handler.Add(protocol.ConnectionID{1, 1, 1, 1}, sess1)
handler.Add(protocol.ConnectionID{2, 2, 2, 2}, sess2)
handler.Close()
handler.Close(testErr)
})
})