named-pipe-wrapper icon indicating copy to clipboard operation
named-pipe-wrapper copied to clipboard

Broken error handling

Open mdavid626 opened this issue 8 years ago • 1 comments

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.

mdavid626 avatar Apr 19 '16 19:04 mdavid626

Same issue here.

IanStorm avatar Aug 10 '16 11:08 IanStorm