ICommunicationObject.Close ICommunicationObject.Close ICommunicationObject.Close ICommunicationObject.Close Method

Definición

Provoca que un objeto de comunicación pase de su estado actual al estado cerrado. Causes a communication object to transition from its current state into the closed state.

Sobrecargas

Close() Close() Close() Close()

Provoca que un objeto de comunicación pase de su estado actual al estado cerrado. Causes a communication object to transition from its current state into the closed state.

Close(TimeSpan) Close(TimeSpan) Close(TimeSpan) Close(TimeSpan)

Provoca que un objeto de comunicación pase de su estado actual al estado cerrado. Causes a communication object to transition from its current state into the closed state.

Close() Close() Close() Close()

Provoca que un objeto de comunicación pase de su estado actual al estado cerrado. Causes a communication object to transition from its current state into the closed state.

public:
 void Close();
public void Close ();
abstract member Close : unit -> unit
Public Sub Close ()
Excepciones

El tiempo de espera predeterminado transcurrió antes de que ICommunicationObject pudiera cerrarse correctamente. The default close timeout elapsed before the ICommunicationObject was able to close gracefully.

Comentarios

Este método provoca que ICommunicationObject pase correctamente del estado Opened al estado Closed.This method causes an ICommunicationObject to gracefully transition from the Opened state to the Closed state. El método Close permite completar cualquier trabajo inacabado antes de devolverse.The Close method allows any unfinished work to be completed before returning. Por ejemplo, terminar de enviar cualquier mensaje almacenado en búfer.For example, finish sending any buffered messages).

ICommunicationObject introduce el estado Closing y permanece en él hasta que la transición al estado Closed se haya completado.The ICommunicationObject enters the Closing state and remains in it until the transition to the Closed state is completed.

Close se devuelve una vez que se ha alcanzado el estado Closed.Close returns once the Closed state is reached.

Si el tiempo de espera predeterminado transcurre antes de que ICommunicationObject pueda cerrarse correctamente, se anulará ICommunicationObject.If the default close timeout elapses before the ICommunicationObject is able to close gracefully, the ICommunicationObject is aborted.

Si se llama a Close en un ICommunicationObject en el estado Created, Opening o Faulted, se anulará ICommunicationObject.If Close is called on an ICommunicationObject in the Created, Opening, or Faulted state, the ICommunicationObject is aborted. Si se llama a Close en un ICommunicationObject en el estado Closing o Closed, la llamada se devolverá inmediatamente.If Close is called on an ICommunicationObject in the Closing or Closed state, the call returns immediately.

Hay también una versión asincrónica del método de cierre que se inicia llamando a BeginClose y se completa llamando a Close.There is also an asynchronous version of the close method that is initiated by calling BeginClose and completed by calling Close.

Close(TimeSpan) Close(TimeSpan) Close(TimeSpan) Close(TimeSpan)

Provoca que un objeto de comunicación pase de su estado actual al estado cerrado. Causes a communication object to transition from its current state into the closed state.

public:
 void Close(TimeSpan timeout);
public void Close (TimeSpan timeout);
abstract member Close : TimeSpan -> unit
Public Sub Close (timeout As TimeSpan)
Parámetros
timeout
TimeSpan TimeSpan TimeSpan TimeSpan

El objeto TimeSpan que especifica el tiempo con el que cuenta la operación de envío para completarse antes de que se agote el tiempo de espera. The TimeSpan that specifies how long the send operation has to complete before timing out.

Excepciones

El tiempo de espera transcurrido antes de que ICommunicationObject pudiera cerrarse correctamente. The timeout elapsed before the ICommunicationObject was able to close gracefully.

Comentarios

Este método provoca que ICommunicationObject pase de forma correcta del estado Opened al estado Closed dentro de un intervalo especificado de tiempo.This method causes an ICommunicationObject to gracefully transition from the Opened state to the Closed state within a specified interval of time. El método Close permite completar cualquier trabajo inacabado antes de devolverse.The Close method allows any unfinished work to be completed before returning. Por ejemplo, terminar de enviar cualquier mensaje almacenado en búfer.For example, finish sending any buffered messages).

ICommunicationObject introduce el estado Closing y permanece en él hasta que la transición al estado Closed se haya completado.The ICommunicationObject enters the Closing state and remains in it until the transition to the Closed state is completed.

Close se devuelve una vez que se ha alcanzado el estado Closed.Close returns once the Closed state is reached.

Si el tiempo de espera transcurre antes de que ICommunicationObject pueda cerrarse correctamente, se anulará ICommunicationObject.If the timeout elapses before the ICommunicationObject is able to gracefully close, the ICommunicationObject is aborted.

Si se llama a Close en un ICommunicationObject en el estado Created, Opening o Faulted, se anulará ICommunicationObject.If Close is called on an ICommunicationObject in the Created, Opening, or Faulted state, the ICommunicationObject is aborted. Si se llama a Close en un ICommunicationObject en el estado Closing o Closed, la llamada se devolverá inmediatamente.If Close is called on an ICommunicationObject in the Closing or Closed state, the call returns immediately.

Hay también una versión asincrónica del método de cierre que se inicia llamando a BeginClose y se completa llamando a Close.There is also an asynchronous version of the close method that is initiated by calling BeginClose and completed by calling Close.

Notas a los implementadores

La operación debe iniciar un TimeoutException si se supera el parámetro timeout especificado. The operation must throw a TimeoutException if the specified timeout is exceeded.

Se aplica a