WSHttpBindingBase.IBindingRuntimePreferences.ReceiveSynchronously 属性

定义

获取一个值,该值指示是同步处理传入请求还是异步处理传入请求。

property bool System::ServiceModel::Channels::IBindingRuntimePreferences::ReceiveSynchronously { bool get(); };
bool System.ServiceModel.Channels.IBindingRuntimePreferences.ReceiveSynchronously { get; }
member this.System.ServiceModel.Channels.IBindingRuntimePreferences.ReceiveSynchronously : bool
 ReadOnly Property ReceiveSynchronously As Boolean Implements IBindingRuntimePreferences.ReceiveSynchronously

属性值

如果同步处理请求,则为 true;如果异步处理请求,则为 false。 默认值为 false,即异步处理请求。

实现

示例

此示例演示如何使用 ReceiveSynchronously 成员。

static void SnippetReceiveSynchronously ()
{
    WSHttpBinding binding = new WSHttpBinding();
    IBindingRuntimePreferences s  =
                       binding.GetProperty<IBindingRuntimePreferences>
                       (new BindingParameterCollection());
    bool receiveSynchronously = s.ReceiveSynchronously;
}
Private Shared Sub SnippetReceiveSynchronously()
    Dim binding As New WSHttpBinding()
    Dim s As IBindingRuntimePreferences = binding.GetProperty(Of IBindingRuntimePreferences) (New BindingParameterCollection())
        Dim receiveSynchronously = s.ReceiveSynchronously

End Sub

适用于