implement a quic.Listener, privatize the Server

This commit is contained in:
Marten Seemann 2017-02-17 15:48:27 +07:00
parent 6dd163020a
commit 5029ab0934
No known key found for this signature in database
GPG key ID: 3603F40B121FCDEA
6 changed files with 221 additions and 139 deletions

View file

@ -11,6 +11,7 @@ import (
)
type mockPacketConn struct {
addr net.Addr
dataToRead []byte
dataReadFrom net.Addr
dataWritten bytes.Buffer
@ -32,7 +33,7 @@ func (c *mockPacketConn) WriteTo(b []byte, addr net.Addr) (n int, err error) {
return c.dataWritten.Write(b)
}
func (c *mockPacketConn) Close() error { c.closed = true; return nil }
func (c *mockPacketConn) LocalAddr() net.Addr { panic("not implemented") }
func (c *mockPacketConn) LocalAddr() net.Addr { return c.addr }
func (c *mockPacketConn) SetDeadline(t time.Time) error { panic("not implemented") }
func (c *mockPacketConn) SetReadDeadline(t time.Time) error { panic("not implemented") }
func (c *mockPacketConn) SetWriteDeadline(t time.Time) error { panic("not implemented") }