Opening TCP listening ports refactored into a function.
Use listenToPort() in cluster.c as well.