Provides means to cleanup after the call.
If the call has already finished normally (request stream has been completed and response stream has been fully read), doesn't do anything.
Otherwise, requests cancellation of the call which should terminate all pending async operations associated with the call.
As a result, all resources being used by the call should be released eventually.
Remarks
Normally, there is no need for you to dispose the call unless you want to utilize the
"Cancel" semantics of invokingDispose.
GetStatus()
public Status GetStatus()
Gets the call status if the call has already finished.
Throws InvalidOperationException otherwise.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003e\u003ccode\u003eAsyncDuplexStreamingCall<TRequest, TResponse>\u003c/code\u003e is a sealed class that serves as the return type for bidirectional streaming calls, implementing the \u003ccode\u003eIDisposable\u003c/code\u003e interface.\u003c/p\u003e\n"],["\u003cp\u003eThis class facilitates asynchronous bidirectional communication by managing a stream of request values (\u003ccode\u003eIClientStreamWriter<TRequest>\u003c/code\u003e) and a stream of response values (\u003ccode\u003eIAsyncStreamReader<TResponse>\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eIt includes methods to access response headers (\u003ccode\u003eResponseHeadersAsync\u003c/code\u003e), get the call's status (\u003ccode\u003eGetStatus\u003c/code\u003e), and retrieve trailing metadata (\u003ccode\u003eGetTrailers\u003c/code\u003e), offering a way to manage and query the state of the streaming call.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eDispose()\u003c/code\u003e allows for cleanup and cancellation of the call, releasing resources and terminating asynchronous operations if the call has not already finished normally.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version is 2.66.0, with previous versions 2.63.0 and 2.48.0 available, providing history and backwards compatibility.\u003c/p\u003e\n"]]],[],null,["# Class AsyncDuplexStreamingCall<TRequest, TResponse> (2.66.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.66.0 (latest)](/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.AsyncDuplexStreamingCall-2)\n- [2.63.0](/dotnet/docs/reference/Grpc.Core/2.63.0/Grpc.Core.AsyncDuplexStreamingCall-2)\n- [2.48.0](/dotnet/docs/reference/Grpc.Core/2.48.0/Grpc.Core.AsyncDuplexStreamingCall-2) \n\n public sealed class AsyncDuplexStreamingCall\u003cTRequest, TResponse\u003e : IDisposable\n\nReturn type for bidirectional streaming calls. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e AsyncDuplexStreamingCall\\\u003cTRequest, TResponse\\\u003e \n\nImplements\n----------\n\n[IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable) \n\nInherited Members\n-----------------\n\n[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)) \n[object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) \n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Grpc.Core](/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core)\n\nAssembly\n--------\n\nGrpc.Core.Api.dll\n\nConstructors\n------------\n\n### AsyncDuplexStreamingCall(IClientStreamWriter\\\u003cTRequest\\\u003e, IAsyncStreamReader\\\u003cTResponse\\\u003e, Func\\\u003cobject, Task\\\u003cMetadata\\\u003e\\\u003e, Func\\\u003cobject, Status\\\u003e, Func\\\u003cobject, Metadata\\\u003e, Action\\\u003cobject\\\u003e, object)\n\n public AsyncDuplexStreamingCall(IClientStreamWriter\u003cTRequest\u003e requestStream, IAsyncStreamReader\u003cTResponse\u003e responseStream, Func\u003cobject, Task\u003cMetadata\u003e\u003e responseHeadersAsync, Func\u003cobject, Status\u003e getStatusFunc, Func\u003cobject, Metadata\u003e getTrailersFunc, Action\u003cobject\u003e disposeAction, object state)\n\nCreates a new AsyncDuplexStreamingCall object with the specified properties.\n\n### AsyncDuplexStreamingCall(IClientStreamWriter\\\u003cTRequest\\\u003e, IAsyncStreamReader\\\u003cTResponse\\\u003e, Task\\\u003cMetadata\\\u003e, Func\\\u003cStatus\\\u003e, Func\\\u003cMetadata\\\u003e, Action)\n\n public AsyncDuplexStreamingCall(IClientStreamWriter\u003cTRequest\u003e requestStream, IAsyncStreamReader\u003cTResponse\u003e responseStream, Task\u003cMetadata\u003e responseHeadersAsync, Func\u003cStatus\u003e getStatusFunc, Func\u003cMetadata\u003e getTrailersFunc, Action disposeAction)\n\nCreates a new AsyncDuplexStreamingCall object with the specified properties.\n\nProperties\n----------\n\n### RequestStream\n\n public IClientStreamWriter\u003cTRequest\u003e RequestStream { get; }\n\nAsync stream to send streaming requests.\n\n### ResponseHeadersAsync\n\n public Task\u003cMetadata\u003e ResponseHeadersAsync { get; }\n\nAsynchronous access to response headers.\n\n### ResponseStream\n\n public IAsyncStreamReader\u003cTResponse\u003e ResponseStream { get; }\n\nAsync stream to read streaming responses.\n\nMethods\n-------\n\n### Dispose()\n\n public void Dispose()\n\nProvides means to cleanup after the call.\nIf the call has already finished normally (request stream has been completed and response stream has been fully read), doesn't do anything.\nOtherwise, requests cancellation of the call which should terminate all pending async operations associated with the call.\nAs a result, all resources being used by the call should be released eventually.\n**Remarks** \nNormally, there is no need for you to dispose the call unless you want to utilize the\n\"Cancel\" semantics of invoking `Dispose`.\n\n### GetStatus()\n\n public Status GetStatus()\n\nGets the call status if the call has already finished.\nThrows InvalidOperationException otherwise.\n\n### GetTrailers()\n\n public Metadata GetTrailers()\n\nGets the call trailing metadata if the call has already finished.\nThrows InvalidOperationException otherwise."]]