TCP socket timeout and drop messages on failure

1) Allow a TCP socket timeout to be specified

2) After a failed attempt to connect or transmit, subsequent events
will be discarded for a random period between 0 and 2^c - 1 seconds,
where c is the number of failed attempts.