Jaa


StreamSocketListenerConnectionReceivedEventArgs Class

Definition

Provides data for a ConnectionReceived event on a StreamSocketListener object.

public ref class StreamSocketListenerConnectionReceivedEventArgs sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class StreamSocketListenerConnectionReceivedEventArgs final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class StreamSocketListenerConnectionReceivedEventArgs
Public NotInheritable Class StreamSocketListenerConnectionReceivedEventArgs
Inheritance
Object Platform::Object IInspectable StreamSocketListenerConnectionReceivedEventArgs
Attributes

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)
App capabilities
ID_CAP_NETWORKING [Windows Phone]

Remarks

The StreamSocketListenerConnectionReceivedEventArgs is used to receive connection data on a StreamSocketListener object.

The StreamSocketListener.BindServiceNameAsync or StreamSocketListener.BindEndpointAsync method is used to bind a StreamSocketListener to a local service name or TCP port.

A StreamSocketListener.ConnectionReceived event occurs if a StreamSocketListener object has been bound to a local service name or TCP port and a connection is received. A StreamSocketListenerConnectionReceivedEventArgs instance is a parameter specified in the callback.

Note From the perspective of a StreamSocket, a Parallel Patterns Library (PPL) completion handler is done executing (and the socket is eligible for disposal) before the continuation body runs. So, to keep your socket from being disposed if you want to use it inside a continuation, you'll need to use one of the techniques described in References to StreamSockets in C++ PPL continuations.

Properties

Socket

The StreamSocket object created when a connection is received by the StreamSocketListener object.

Applies to

See also