Added timeout to TCP comms.