-api-id | -api-type |
---|---|
P:Windows.Networking.Sockets.MessageWebSocket.OutputStream |
winrt property |
Gets the output stream to write to the remote network destination on a MessageWebSocket object.
A sequential stream of bytes to be written to the remote destination as a single message.
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.