信息
您所需的主题如下所示。但此主题未包含在此库中。

StreamSocketListener.ConnectionReceived | connectionreceived Event

指示在 StreamSocketListener 对象上收到连接的事件。

语法


function onConnectionReceived(eventArgs) { /* 代码 */ }
 
// addEventListener syntax
streamSocketListener.addEventListener("connectionreceived", onConnectionReceived);
streamSocketListener.removeEventListener("connectionreceived", onConnectionReceived);
 
- or -

streamSocketListener.onconnectionreceived = onConnectionReceived;


事件信息

委托 TypedEventHandler<StreamSocketListener, StreamSocketListenerConnectionReceivedEventArgs>

备注

若要在 StreamSocketListener 对象上侦听连接,应用程序必须将 ConnectionReceived 事件分配给事件处理程序,然后调用 BindEndpointAsyncBindServiceNameAsync 方法将 StreamSocketListener 绑定到本地服务名或要在其上进行侦听的 UDP 端口。 若要侦听 Bluetooth RFCOMM,则需绑定到 Bluetooth 服务 ID。

要求

最低支持客户端

Windows 8

最低支持服务器

Windows Server 2012

最低支持电话

Windows Phone 8

命名空间

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

元数据

Windows.winmd

Capabilities

ID_CAP_NETWORKING [Windows Phone]

另请参见

StreamSocket
StreamSocketListener
StreamSocketListenerConnectionReceivedEventArgs

 

 

显示: