共用方式為


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物件。

適用於

另請參閱