mnet: fix PacketConn closing

This commit is contained in:
Brian Picciano 2019-03-01 14:37:41 -05:00
parent a52230b972
commit 015edcd69a

View File

@ -130,7 +130,11 @@ func (l *Listener) Accept() (net.Conn, error) {
// logging.
func (l *Listener) Close() error {
mlog.Info("listener closing", l.ctx)
if l.Listener != nil {
return l.Listener.Close()
} else {
return l.PacketConn.Close()
}
}
////////////////////////////////////////////////////////////////////////////////