If you use, for example, System.IO.Pipesand NamedPipeServerStream, you will get an IOException when the pipe breaks or disconnects.
NamedPipeClientStream , , , NamedPipeClientStream.Connect() NamedPipeClientStream.Connect(Int32) - , , StreamReader.ReadLine() IOException, - .
NamedPipeClientStream.IsConnected , , .
user474407