ServiceThrottle.MaxConcurrentCalls Propriedade

Definição

Obtém ou define o número máximo de mensagens processando ativamente entre todos os objetos do dispatcher em um ServiceHost.Gets or sets the maximum number of messages actively processing across all dispatcher objects in a ServiceHost.

public:
 property int MaxConcurrentCalls { int get(); void set(int value); };
public int MaxConcurrentCalls { get; set; }
member this.MaxConcurrentCalls : int with get, set
Public Property MaxConcurrentCalls As Integer

Valor da propriedade

Int32

O limite superior de mensagens ativas no serviço.The upper limit of active messages in the service. O padrão é 16 * número de processadores no computador.The default is 16 * number of processors in the computer.

Exemplos

O exemplo de código a seguir mostra o uso típico do ServiceThrottle referenciando o ServiceThrottlingBehavior em um arquivo de configuração de aplicativo.The following code example shows the typical use of the ServiceThrottle by referencing the ServiceThrottlingBehavior in an application configuration file. Nesse caso, os valores especificados estabelecem, no máximo, um processamento de mensagem de uma só vez de uma conexão com um InstanceContext .In this case, the values that are specified establish, at most, one message processing at one time from one connection to one InstanceContext. O uso do mundo real deve ser determinado por meio da experiência.Real-world usage must be determined through experience.

<configuration>
  <appSettings>
    <!-- use appSetting to configure base address provided by host -->
    <add key="baseAddress" value="http://localhost:8080/ServiceMetadata" />
  </appSettings>
  <system.serviceModel>
    <services>
      <service 
        name="Microsoft.WCF.Documentation.SampleService"
        behaviorConfiguration="Throttled" >
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8080/SampleService"/>
          </baseAddresses>
        </host>
        <endpoint
          address=""
          binding="wsHttpBinding"
          contract="Microsoft.WCF.Documentation.ISampleService"
         />
        <endpoint
          address="mex"
          binding="mexHttpBinding"
          contract="IMetadataExchange"
         />
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior  name="Throttled">
          <serviceThrottling 
            maxConcurrentCalls="1" 
            maxConcurrentSessions="1" 
            maxConcurrentInstances="1"
          />
          <serviceMetadata 
            httpGetEnabled="true" 
            httpGetUrl=""
          />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>

Comentários

A MaxConcurrentCalls propriedade especifica o número máximo de mensagens processando ativamente em todos os objetos Dispatcher em ServiceHost um objeto.The MaxConcurrentCalls property specifies the maximum number of messages actively processing across all the dispatcher objects in a ServiceHost object. Cada canal pode ter uma mensagem pendente que não conta com o valor de MaxConcurrentCalls até que Windows Communication Foundation (WCF) comece a processá-lo.Each channel can have one pending message that does not count against the value of MaxConcurrentCalls until Windows Communication Foundation (WCF) begins to process it.

Observação

Um rastreamento é gravado toda vez que o valor dessa propriedade é excedido.A trace is written every time the value of this property is exceeded.

Aplica-se a