語言

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 需求

規格需求 Description
裝置系列
Windows 10 (已於 10.0.10240.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v1.0 引進)

備註

StreamSocketListennerConnectionReceivedEventArgs 用於接收 StreamSocketListener 物件上的連線資料。

StreamSocketListener.BindServiceNameAsync 或 StreamSocketListener.BindEndpointAsync 方法用於將 StreamSocketListener 綁定到本地服務名稱或 TCP 埠。

當 StreamSocketSocketListener 物件綁定到本地服務名稱或 TCP 埠且接收到連線時,會發生 StreamSocketListener.ConnectionReceived 事件。 StreamSocketListenerConnectionReceivedEventArgs 實例是回調中指定的參數。

註 從 StreamSocket 的角度來看,平行模式函式庫(PPL)完成處理程序會先執行(且該套接字有資格丟棄),然後才會執行續寫本體。 所以,如果你想在續寫中使用,為了避免你的 socket 被丟棄,你需要使用《 C++ PPL 續接中 StreamSockets 參考》中描述的其中一種技術。

屬性

名稱 Description
Socket

StreamSocket 物件是當 StreamSocketListen 物件接收到連線時所建立的。

適用於

另請參閱