StreamSocketListenerConnectionReceivedEventArgs 类

定义

StreamSocketListener 对象上的 ConnectionReceived 事件提供数据。

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
继承
Object Platform::Object IInspectable StreamSocketListenerConnectionReceivedEventArgs
属性

Windows 要求

设备系列
Windows 10 (在 10.0.10240.0 中引入)
API contract
Windows.Foundation.UniversalApiContract (在 v1.0 中引入)
应用功能
ID_CAP_NETWORKING [Windows Phone]

注解

StreamSocketListenerConnectionReceivedEventArgs 用于接收 StreamSocketListener 对象上的连接数据。

StreamSocketListener.BindServiceNameAsyncStreamSocketListener.BindEndpointAsync 方法用于将 StreamSocketListener 绑定到本地服务名称或 TCP 端口。

如果 StreamSocketListener 对象已绑定到本地服务名称或 TCP 端口,并且收到连接,则会发生 StreamSocketListener.ConnectionReceived 事件。 StreamSocketListenerConnectionReceivedEventArgs 实例是在回调中指定的参数。

注意StreamSocket 的角度来看,并行模式库 (PPL) 完成处理程序执行 (,并且套接字在延续正文运行之前有资格进行处置) 。 因此,如果要在延续中使用它,若要防止释放套接字,需要使用 C++ PPL 延续中对 StreamSocket 的引用中所述的技术之一。

属性

Socket

StreamSocketListener 对象接收连接时创建的 StreamSocket 对象。

适用于

另请参阅