Stream.CanTimeout 屬性

定義

取得值,該值判斷目前的資料流是否可以逾時。Gets a value that determines whether the current stream can time out.

public:
 virtual property bool CanTimeout { bool get(); };
[System.Runtime.InteropServices.ComVisible(false)]
public virtual bool CanTimeout { get; }
member this.CanTimeout : bool
Public Overridable ReadOnly Property CanTimeout As Boolean

屬性值

值,判斷目前的資料流是否可以逾時。A value that determines whether the current stream can time out.

屬性

備註

CanTimeout 屬性一定會傳回 falseThe CanTimeout property always returns false. 某些串流的執行需要不同的行為, NetworkStream例如,如果網路連線中斷或遺失,就會發生這種情況。Some stream implementations require different behavior, such as NetworkStream, which times out if network connectivity is interrupted or lost. 如果您要執行必須能夠超時的資料流程,則應該覆寫此屬性以true傳回。If you are implementing a stream that must be able to time out, this property should be overridden to return true.

適用於

另請參閱