0 out of 1 rated this helpful - Rate this topic

StreamSocketListener class

Supports listening for an incoming network connection using a TCP stream socket.

Syntax


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

Attributes

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

Members

The StreamSocketListener class has these types of members:

Constructors

The StreamSocketListener class has these constructors.

ConstructorDescription
StreamSocketListener Creates a new StreamSocketListener object.

 

Events

The StreamSocketListener class has these events.

EventDescription
ConnectionReceived An event that indicates that a connection was received on the StreamSocketListener object.

 

Methods

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

MethodDescription
BindEndpointAsync Starts a bind operation on a StreamSocketListener to a local hostname and a local service name.
BindServiceNameAsync Starts a bind operation on a StreamSocketListener to a local service name.
Close [C++, JavaScript]Closes the StreamSocketListener object.
Dispose [C#, VB]Performs tasks associated with freeing, releasing, or resetting unmanaged resources.

 

Properties

The StreamSocketListener class has these properties.

PropertyAccess typeDescription

Control

Read-onlyGets socket control data on a StreamSocketListener object.

Information

Read-onlyGets socket information for the StreamSocketListener object.

 

Remarks

The StreamSocketListener class supports listening for an incoming network connection using a TCP stream socket and accepting the connection.

The typical order of operations is as follows:

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

internetClientServer
privateNetworkClientServer
ID_CAP_NETWORKING [Windows Phone]

See also

Other resources
Connecting to network services (Windows Store apps using JavaScript and HTML)
Connecting to network services (Windows Store apps using C#/VB/C++ and XAML)
How to use advanced socket controls (Windows Store apps using JavaScript and HTML)
How to use advanced socket controls (Windows Store apps using C#/VB/C++ and XAML)
Quickstart: Connecting to a network resource with a stream socket (Windows Store apps using JavaScript and HTML)
Troubleshoot and debug network connections
Reference
IClosable
Object
StreamSocket
StreamSocketListenerConnectionReceivedEventArgs
StreamSocketListenerControl
StreamSocketListenerInformation

 

 

Build date: 2/25/2013

© 2013 Microsoft. All rights reserved.