use the manet dial args in order to figure out the listener

This commit is contained in:
Topper Bowers 2019-08-21 15:16:17 +02:00 committed by Michiel De Backker
parent 006488daf2
commit e838527c2c

View File

@ -21,8 +21,12 @@ type Listener struct {
}
func newListener(config *connConfig) (*Listener, error) {
lnet, lnaddr, err := manet.DialArgs(config.maAddr)
if err != nil {
return nil, err
}
ln, err := net.Listen(config.addr.Network(), config.addr.String())
ln, err := net.Listen(lnet, lnaddr)
if err != nil {
return nil, fmt.Errorf("failed to listen: %v", err)
}