StreamSocketListenerControl class

Applies to Windows and Windows Phone

Provides socket control data on a StreamSocketListener object.

Syntax


var streamSocketListenerControl = StreamsocketListener.Control;

Attributes

[DualApiPartition()]
[MarshalingBehavior(Agile)]
[Version(0x06020000)]

Members

The StreamSocketListenerControl class has these types of members:

Methods

The StreamSocketListenerControl class inherits methods from the Object class (C#/VB/C++).

Properties

The StreamSocketListenerControl class has these properties.

PropertyAccess typeDescription

QualityOfService

Read/writeThe quality of service to be set on a StreamSocket object created when a connection is received by the StreamSocketListener object.

 

Remarks

The StreamSocketListenerControl class provides access to advanced socket control data on a StreamSocketListener object.

A StreamSocketListenerControl object is automatically created with the parent StreamSocketListener object. The StreamSocketListener.Control property provides access to the associated StreamSocketListenerControl object.

Any changes to the StreamSocketListenerControl property values must be set before the StreamSocketListener is bound. So changes to the QualityOfService property must be set before the BindServiceNameAsync or BindEndpointAsync method is called on the StreamSocketListener.

The following example creates a StreamSocketListener, and then demonstrates how to set the QualityOfService property to LowLatency. After this is done, the app can bind and listen on the StreamSocketListener.


var listenerSocket = new Windows.Networking.Sockets.StreamSocketListener();

// Get the current setting for this option
// This isn't required, but it shows how to get the current setting
var currentSetting = listenerSocket.Control.QualityOfService; 

// Set QualityOfService to lowLatency
listenerSocket.Control.QualityOfService = SocketQualityOfService.lowLatency;
   
// Now you can call the BindServiceNameAsync or BindEndpointAsync method to listen for connections.


For more information on using StreamSocketListenerControl, see How to use advanced socket controls (HTML) and How to use advanced socket controls (XAML).

Requirements

Minimum supported client

Windows 8 [Windows Store apps, desktop apps]

Minimum supported server

Windows Server 2012 [Windows Store apps, desktop apps]

Minimum supported phone

Windows Phone 8

Namespace

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

Metadata

Windows.winmd

DLL

Windows.Networking.dll

Capabilities

ID_CAP_NETWORKING [Windows Phone]

See also

Other resources
Connecting with sockets (HTML)
Connecting with sockets (XAML)
How to use advanced socket controls (HTML)
How to use advanced socket controls (XAML)
Reference
Object
StreamSocketListener
StreamSocketListener.Control
StreamSocketListenerInformation
Samples
Bluetooth Rfcomm Chat sample
ControlChannelTrigger StreamSocket sample
Proximity sample
StreamSocket sample

 

 

Show:
© 2014 Microsoft