Broken error handling
mdavid626 opened this issue · 1 comments
mdavid626 commented
If I start a server instance
var server = new NamedPipeServer<TestClass>("MyServerPipe");
server.Start();
the failure of pipe creation is not detectable. There can be an error (for example the pipe is busy), which is simply written to console output, but no events are thrown (Error). This code causes the problem:
while (this._shouldKeepRunning)
this.WaitForConnection(this._pipeName);
in this.WaitForConnections this can fail:
pipe1 = PipeServerFactory.CreateAndConnectPipe(pipeName)
and then the error is handled in try catch, but while cycle keeps running and tries again and no error event is thrown.
So how to detect if server.Start was unsuccessful?
Thanks.
IanStorm commented
Same issue here.