StreamSocketListenerConnectionReceivedEventArgs StreamSocketListenerConnectionReceivedEventArgs StreamSocketListenerConnectionReceivedEventArgs StreamSocketListenerConnectionReceivedEventArgs Class

Definition

Provides data for a ConnectionReceived event on a StreamSocketListener object.

public : sealed class StreamSocketListenerConnectionReceivedEventArgs : IStreamSocketListenerConnectionReceivedEventArgs
public sealed class StreamSocketListenerConnectionReceivedEventArgs : IStreamSocketListenerConnectionReceivedEventArgs
Public NotInheritable Class StreamSocketListenerConnectionReceivedEventArgs Implements IStreamSocketListenerConnectionReceivedEventArgs
// This class does not provide a public constructor.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
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 Socket Socket Socket

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

public : StreamSocket Socket { get; }
public StreamSocket Socket { get; }
Public ReadOnly Property Socket As StreamSocket
var streamSocket = streamSocketListenerConnectionReceivedEventArgs.socket;
Value
StreamSocket StreamSocket StreamSocket StreamSocket

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

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
ID_CAP_NETWORKING [Windows Phone]

Remarks

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.

See Also

See Also