Skip to main content
StreamWebSocket.OutputStream | outputStream property

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

Syntax


var outputStream = streamWebSocket.outputStream;

public IOutputStream OutputStream { get; }

Public ReadOnly Property OutputStream As IOutputStream

public:
property IOutputStream^ OutputStream { 
   IOutputStream^ get();
}

Property value

Type: IOutputStream

A sequential stream of bytes to be written to the remote destination.

Remarks

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

The following specific errors can occur when you call IOutputStream.FlushAsync on the OutputStream of a StreamWebSocket 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.

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.Networking.Sockets
Windows::Networking::Sockets [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.Networking.Sockets
Windows::Networking::Sockets [C++]

Metadata

Windows.winmd

See also

DataWriter
IOutputStream
StreamWebSocket