Compartilhar via


WebPubSubServiceClient.CloseAllConnectionsAsync Método

Definição

Feche as conexões no hub.

public virtual System.Threading.Tasks.Task<Azure.Response> CloseAllConnectionsAsync (System.Collections.Generic.IEnumerable<string> excluded = default, string reason = default, Azure.RequestContext context = default);
abstract member CloseAllConnectionsAsync : seq<string> * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.CloseAllConnectionsAsync : seq<string> * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function CloseAllConnectionsAsync (Optional excluded As IEnumerable(Of String) = Nothing, Optional reason As String = Nothing, Optional context As RequestContext = Nothing) As Task(Of Response)

Parâmetros

excluded
IEnumerable<String>

Exclua essas connectionIds ao fechar as conexões no hub.

reason
String

O motivo para fechar a conexão do cliente.

context
RequestContext

O contexto de solicitação, que pode substituir os comportamentos padrão do pipeline do cliente por chamada.

Retornos

A resposta retornada do serviço.

Exceções

O serviço retornou um código de status sem êxito.

Exemplos

Este exemplo mostra como chamar CloseAllConnectionsAsync.

var client = new WebPubSubServiceClient("<https://my-service.azure.com>", "<hub>");

Response response = await client.CloseAllConnectionsAsync();
Console.WriteLine(response.Status);

Este exemplo mostra como chamar CloseAllConnectionsAsync com todos os parâmetros.

var client = new WebPubSubServiceClient("<https://my-service.azure.com>", "<hub>");

Response response = await client.CloseAllConnectionsAsync(new String[]{"<excluded>"}, "<reason>");
Console.WriteLine(response.Status);

Comentários

Esquema para Response Error:

{
              code: string,
              message: string,
              target: string,
              details: [ErrorDetail],
              inner: {
                code: string,
                inner: InnerError
              }
            }

Aplica-se a