Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
This topic has not yet been rated - Rate this topic

StreamWebSocket class

Supports network communication that allows reading and writing streams using a WebSocket.

Syntax


public sealed class StreamWebSocket : Object,
    IWebSocket,
    IDisposable

Attributes

ActivatableAttribute(NTDDI_WIN8)
DualApiPartitionAttribute()
MarshalingBehaviorAttribute(Agile)
ThreadingAttribute(Both)
VersionAttribute(NTDDI_WIN8)

Members

The StreamWebSocket class has these types of members:

Constructors

The StreamWebSocket class has these constructors.

ConstructorDescription
StreamWebSocket Creates a new StreamWebSocket object.

 

Events

The StreamWebSocket class has these events.

EventDescription
Closed Occurs when a close frame is received on the StreamWebSocket object as part of the close handshake.

 

Methods

The StreamWebSocket class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.

MethodDescription
Close() [C++, JavaScript]Closes the StreamWebSocket and sends an empty close frame to the server.
Close(UInt16, String) Closes the StreamWebSocket and indicates a reason for the closure.
ConnectAsync Starts an asynchronous operation to connect to a remote network destination on a StreamWebSocket object.
Dispose [C#, VB]Performs tasks associated with freeing, releasing, or resetting unmanaged resources.
SetRequestHeader Adds an HTTP request header to the HTTP request message used in the WebSocket protocol handshake by the StreamWebSocket object.

 

Properties

The StreamWebSocket class has these properties.

PropertyAccess typeDescription

Control

Read-onlyGets socket control data on a StreamWebSocket object.

Information

Read-onlyGets socket information on a StreamWebSocket object.

InputStream

Read-onlyGets the input stream to read from the remote destination on a StreamWebSocket object.

OutputStream

Read-onlyGets the output stream to write to the remote network destination on a StreamWebSocket object.

 

Remarks

The StreamWebSocket class provides a stream-based abstraction of the message-based WebSocket protocol. This is useful for scenarios in which large files (such as photos or movies) need to be transferred. Using StreamWebSocket allows sections of a message to be read with each read operation, rather than requiring the entire message to be read in a single operation (as with MessageWebSocket).

StreamWebSocket only supports binary messages. For UTF-8 messages, MessageWebSocket must be used.

Requirements

Minimum supported client

Windows 8 [Windows Store apps, desktop apps]

Minimum supported server

Windows Server 2012 [Windows Store apps, desktop apps]

Namespace

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

Metadata

Windows.winmd

DLL

Windows.Networking.dll

Capabilities

internetClient
privateNetworkClientServer

See also

Connecting with WebSockets
Quickstart: Connecting with a StreamWebSocket
Connecting with WebSockets sample
ControlChannelTrigger StreamWebSocket sample

 

 

Build date: 2/25/2013

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.