Added timeout for TCP connect
Added error checking for ip address