Note
Closing the NetworkStream closes the connection.
Similarly Closing, Disposing, or the finalization of the IrDAClient
Disposes the NetworkStream.
This is new behaviour post 2.0.60828.0.
public NetworkStream GetStream()
Public Function GetStream As NetworkStream
public:
NetworkStream^ GetStream()
member GetStream : unit -> NetworkStream
GetStream returns a NetworkStream that you can use to send and receive data. The NetworkStream class inherits from the Stream class, which provides a rich collection of methods and properties used to facilitate network communications.
You must call the Connect(IrDAEndPoint) method, or one of its overloads, first, or the GetStream method will throw an InvalidOperationException. After you have obtained the NetworkStream, call the Write(Byte, Int32, Int32) method to send data to the remote host. Call the Read(Byte, Int32, Int32) method to receive data arriving from the remote host. Both of these methods block until the specified operation is performed. You can avoid blocking on a read operation by checking the DataAvailable property. A true value means that data has arrived from the remote host and is available for reading. In this case, Read is guaranteed to complete immediately. If the remote host has shutdown its connection, Read will immediately return with zero bytes.
InvalidOperationException | The IrDAClient is not connected to a remote host. |
ObjectDisposedException | The IrDAClient has been closed. |