Adding client and server heartbeat monitoring for streams.

Heartbeats allow the server and client to be notified if the connection is broken. If either doesn't receive a heartbeat for more than 2x the proposed time the connection will be closed. It's a good idea to set the read_write_timeout to 2x the heartbeat so your socket will be open.

heartbeat = 0 // disabled
heartbeat = null // use server proposed
heartbeat = 30 // use client proposed value of 30 seconds