Dela via


MessageWebSocket.OutputStream Property

Definition

Gets the output stream to write to the remote network destination on a MessageWebSocket object.

public:
 property IOutputStream ^ OutputStream { IOutputStream ^ get(); };
IOutputStream OutputStream();
public IOutputStream OutputStream { get; }
var iOutputStream = messageWebSocket.outputStream;
Public ReadOnly Property OutputStream As IOutputStream

Property Value

A sequential stream of bytes to be written to the remote destination as a single message.

Implements

Remarks

This property is used with the DataWriter object to write outgoing data to be sent to the remote network destination on a socket object.

The following specific errors can occur when you call IOutputStream.FlushAsync on the OutputStream of a MessageWebSocket if the websocket is in an invalid state at the time.

  • If the websocket instance has been explicitly closed (via delete, Dispose, or Close) or implicitly closed (fallen out of scope), FlushAsync throws an RO_E_CLOSED exception.
  • If the IOutputStream object associated with the websocket has been explicitly closed (via delete, Dispose, or Close) or implicitly closed (for example, by disposing of a DataWriter instance before calling DetachStream on it), FlushAsync throws an RO_E_CLOSED exception.
  • If the websocket is not connected yet (ConnectAsync has not been called), then FlushAsync throws an E_ILLEGAL_METHOD_CALL exception.

Applies to

See also