Unless I'm mistaken, this does not prevent the port from being taken between the isPortFree check and the actual initialization of the GatewayServer. I think this could be moved closer to when a server socket is initialized. It's still a useful quick & dirty check. I can improve the GatewayServer later.