Quantcast
Channel: .NET Framework Class Libraries forum
Viewing all articles
Browse latest Browse all 8156

NamedPipeServerStream calls Async callback when disposed

$
0
0
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

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.

Viewing all articles
Browse latest Browse all 8156

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>