Hallo!
I've got a strange behaviour of the NamedPipeServerStream class.
It calls async callback function, when disposing.
1. I start async wait for connection
2. Next, I finish it by disposing the pipe.
3. At this point, somewhere in Dispose method PipeWaitConnectionCallback is called and I get ObjectDisposedException in a call to pipeServer.EndWaitForConnection
The question is - why callback method is called in Dispose of NamedPipeServerStream? I am really not expect such behaviour.
I've got a strange behaviour of the NamedPipeServerStream class.
It calls async callback function, when disposing.
1. I start async wait for connection
pipeServer =
newNamedPipeServerStream("MyPipe", PipeDirection.InOut,1,PipeTransmissionMode.Byte,PipeOptions.Asynchronous);pipeServer.BeginWaitForConnection(
newAsyncCallback(PipeWaitConnectionCallback), null);2. Next, I finish it by disposing the pipe.
pipeServer.Dispose();
3. At this point, somewhere in Dispose method PipeWaitConnectionCallback is called and I get ObjectDisposedException in a call to pipeServer.EndWaitForConnection
The question is - why callback method is called in Dispose of NamedPipeServerStream? I am really not expect such behaviour.