Partager via


BidirectionalStream.Cancel Method

Definition

Cancels the stream.

[Android.Runtime.Register("cancel", "()V", "GetCancelHandler", ApiSince=34)]
public abstract void Cancel ();
[<Android.Runtime.Register("cancel", "()V", "GetCancelHandler", ApiSince=34)>]
abstract member Cancel : unit -> unit
Attributes

Remarks

Cancels the stream. Can be called at any time after #start. Callback#onCanceled onCanceled() will be invoked when cancelation is complete and no further callback methods will be invoked. If the stream has completed or has not started, calling cancel() has no effect and onCanceled() will not be invoked. If the Executor passed in during BidirectionalStream construction runs tasks on a single thread, and cancel() is called on that thread, no listener methods (besides onCanceled()) will be invoked after cancel() is called. Otherwise, at most one callback method may be invoked after cancel() has completed.

Java documentation for android.net.http.BidirectionalStream.cancel().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to