I​Web​Socket I​Web​Socket I​Web​Socket Interface

Definition

Provides access to network communication that allows reading and writing using a WebSocket.

public : interface IWebSocketpublic interface IWebSocketPublic Interface IWebSocket
Inheritance
IClosableIDisposableIDisposable
IWebSocketIWebSocketIWebSocket
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Inherited Members

Inherited methods

Properties

OutputStream OutputStream OutputStream

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

public : IOutputStream OutputStream { get; }public IOutputStream OutputStream { get; }Public ReadOnly Property OutputStream As IOutputStream
Value
IOutputStream IOutputStream IOutputStream

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

Attributes

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.

Methods

Close(UInt16, String) Close(UInt16, String) Close(UInt16, String)

Closes the IWebSocket.

public : void Close(unsigned short code, PlatForm::String reason)public void Close(UInt16 code, String reason)Public Function Close(code As UInt16, reason As String) As void
Parameters
code
unsigned short UInt16 UInt16

Status code indicating the reason for closure.

reason
PlatForm::String String String

Optional UTF-8-encoded data with additional information about the closure.

Attributes

ConnectAsync(Uri) ConnectAsync(Uri) ConnectAsync(Uri)

Starts an asynchronous operation to connect to a remote network destination on a IWebSocket object.

public : IAsyncAction ConnectAsync(Uri uri)public IAsyncAction ConnectAsync(Uri uri)Public Function ConnectAsync(uri As Uri) As IAsyncAction
Parameters
uri
Uri Uri Uri

An absolute Uri for the server to connect to.

Returns

An asynchronous connect operation on a IWebSocket object.

Attributes
See Also
UriUriUri

SetRequestHeader(String, String) SetRequestHeader(String, String) SetRequestHeader(String, String)

Adds an HTTP request header to the HTTP request message used in the WebSocket protocol handshake by the IWebSocket object.

public : void SetRequestHeader(PlatForm::String headerName, PlatForm::String headerValue)public void SetRequestHeader(String headerName, String headerValue)Public Function SetRequestHeader(headerName As String, headerValue As String) As void
Parameters
headerName
PlatForm::String String String

The name of the request header.

headerValue
PlatForm::String String String

The value of the request header.

Attributes

Events

Closed Closed Closed

Occurs when a close frame is received on the IWebSocket object as part of the close handshake.

public : abstract event TypedEventHandler Closedpublic abstract event TypedEventHandler ClosedPublic MustInherit Event Closed
Attributes

See Also