Added ping timeout check.
Added timeout to write messages in peer.