Added timeouts and reduced to a single port for incoming and outgoing