语言

CommunicationObject.OnClose(TimeSpan) 方法

定义

由于调用同步关闭操作,在通信对象转换为结束状态后,在通信对象上插入处理。

protected:
 abstract void OnClose(TimeSpan timeout);
protected abstract void OnClose(TimeSpan timeout);
abstract member OnClose : TimeSpan -> unit
Protected MustOverride Sub OnClose (timeout As TimeSpan)

参数

timeout
TimeSpan

指定 TimeSpan 关闭操作在超时前必须完成多长时间。

例外

在处于状态的对象 上调用 < a0/>。

在操作完成之前,已超出为操作分配的默认时间间隔。

关闭对象时发生通信错误。

注解

该方法Close在通信对象最初处于OnClose状态时调用Opened。

若要在通信对象由于调用异步 BeginClose 操作而转换为结束状态后插入处理,请使用 OnBeginClose 该方法。

适用于