properly close the UDP proxy used in the integration tests

This commit is contained in:
Marten Seemann
2018-02-22 17:23:44 +08:00
parent 6322412eb8
commit b1095d0661
2 changed files with 44 additions and 0 deletions

View File

@@ -137,6 +137,13 @@ func NewQuicProxy(local string, version protocol.VersionNumber, opts *Opts) (*Qu
// Close stops the UDP Proxy
func (p *QuicProxy) Close() error {
p.mutex.Lock()
defer p.mutex.Unlock()
for _, c := range p.clientDict {
if err := c.ServerConn.Close(); err != nil {
return err
}
}
return p.conn.Close()
}