NamedPipeServerStream::Disconnect Method ()

 

Disconnects the current connection.

Namespace:   System.IO.Pipes
Assembly:  System.Core (in System.Core.dll)

public:
[SecurityCriticalAttribute]
void Disconnect()

Exception Condition
InvalidOperationException

No pipe connections have been made yet.

-or-

The connected pipe has already disconnected.

-or-

The pipe handle has not been set.

ObjectDisposedException

The pipe is closed.

Calling the Disconnect method will block until all the sent characters have been read unless the transmission mode of the pipe is set to Message and the buffer size is set in the constructor that created the NamedPipeServerStream object. In this case, not all of the messages will be received. Calling WaitForPipeDrain causes the server to block until all the data has been read from the pipe.

.NET Framework
Available since 3.5
Return to top
Show: