Clean way to terminate a TcpStream::read

Hi again,

So I've been trying to enhance your example to allow for repeating ctrlc sessions and finding it surprisingly difficult. By repeating ctrlc sessions I mean that after the Cntrl-C is processed, another read_exact can be performed (perhaps after a second of sleep) and once again, the Cntrl-C can be used to abort the read.

All my attempts to do this have failed in various ways. It appears to be the case that the original stream resulting from the TcpStream::connect() method needs to be re-established.

This means that the handler must be retooled to accept a new instance of the handle variable and this is tricky because you are only allowed to call ctrlc::set_handler() once.

So I started to see if I could create a new mutable struct type that would have a lifetime of the program and to which the ctrlc handler could refer, and only it's contents would vary with a new version of TcpStream::connect() each "ctrlc session".

This problem seems suprisingly more difficult than the one you already solved. I'm wondering if you have any ideas how to tackle it?

Thanks so much.