Big refactoring & debug

use just `sock.listen(0)`, I could not imagine the case when customization for this var is needed