Add a timeout when trying to connect to the server, otherwise sometimes it just hangs

Signed-off-by: Doug Davis <dug@us.ibm.com>