Issues Re-using Port

I’ve recently encountered some issues while reusing ports in testing of a libp2p node. From searching the web I see some general issues with reusing tcp ports. I’m assuming these same limitation exist in go. I’m wondering if go-libp2p mitigates this in any way? Or is it generally advised not to re-use ports?

Hey @ansermino! Could you post the code somewhere? You should be closing the host (host.Close()) and that should free up the ports. We set the SO_REUSEPORT/ADDR on the socket, so I guess the usual TIME_WAIT and CLOSE_WAIT states don’t apply.

Seems the issue is no longer reproducible. Thank you for clarify this!