How to reliably terminate a remote process (Ctrl-C)

Jul 20, 2013 at 11:42 PM
I figured out that writing 3 to ShellStream will usually terminate a remote running process:
However this doesn't always work. Does anyone know of a way to make this reliable? I tried writing it multiple times but if it didn't work the 1st time it won't work regardless of how many times you send it again.