handle TCP socket creation and port assignement [distribute case not functional]