IInstanceContextProvider.GetExistingInstanceContext 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
收到新消息时调用。
public:
System::ServiceModel::InstanceContext ^ GetExistingInstanceContext(System::ServiceModel::Channels::Message ^ message, System::ServiceModel::IContextChannel ^ channel);
public System.ServiceModel.InstanceContext GetExistingInstanceContext(System.ServiceModel.Channels.Message message, System.ServiceModel.IContextChannel channel);
abstract member GetExistingInstanceContext : System.ServiceModel.Channels.Message * System.ServiceModel.IContextChannel -> System.ServiceModel.InstanceContext
Public Function GetExistingInstanceContext (message As Message, channel As IContextChannel) As InstanceContext
参数
- message
- Message
传入消息。
- channel
- IContextChannel
接收消息的通道。
返回
InstanceContext用于处理消息的对象;返回null指示 WCF 创建新InstanceContext对象。
注解
GetExistingInstanceContext收到消息时调用该方法。
InstanceContext返回要处理消息的对象,或 null。 在这种情况下 null,WCF 会为消息创建一个新 InstanceContext 对象,然后调用该方法 InitializeInstanceContext 。
如果返回 null,则新 InstanceContext 对象将经历限制系统并递增计数 ServiceThrottle.MaxConcurrentInstances。