TcpListener.Active 屬性

定義

取得值,指出 TcpListener 是否正在接聽用戶端連接。

protected:
 property bool Active { bool get(); };
protected bool Active { get; }
member this.Active : bool
Protected ReadOnly Property Active As Boolean

屬性值

如果 TcpListener 正在接聽則為 true,否則為 false

備註

衍生自 TcpListener 的類別可以使用這個屬性來判斷 目前是否 Socket 正在接聽連入連線嘗試。 屬性 Active 可用來避免重複 Start 嘗試。

適用於

另請參閱