forked from TrueCloudLab/frostfs-node
44def45ff4
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
18 lines
350 B
Go
18 lines
350 B
Go
package network
|
|
|
|
import (
|
|
"net"
|
|
|
|
"github.com/multiformats/go-multiaddr"
|
|
manet "github.com/multiformats/go-multiaddr-net"
|
|
)
|
|
|
|
// Listen announces on the local network address.
|
|
func Listen(addr multiaddr.Multiaddr) (net.Listener, error) {
|
|
mLis, err := manet.Listen(addr)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return manet.NetListener(mLis), nil
|
|
}
|