shutDown

Stops listening, closes both the send and listen sockets, and waits (up to LISTENER_JOIN_TIMEOUT_MILLIS) for the listener thread to terminate.

Both sockets are released even if one of the steps fails, so a partial failure never leaks a bound port.

Return

Result.success if every step succeeded, or the first failure encountered