Skip to content

Commit

Permalink
Make ServiceChannelProxy implement IAsyncDisposable
Browse files Browse the repository at this point in the history
So that channels created through a `ChannelFactory<T>` without inheriting from `ClientBase<T>` can also benefit from the asynchronous disposal improvements introduced in dotnet#4865.

Fixes dotnet#5270
  • Loading branch information
0xced authored and organich committed Aug 31, 2024
1 parent 12e7f1b commit 614eaed
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

namespace System.ServiceModel.Channels
{
public class ServiceChannelProxy : DispatchProxy, ICommunicationObject, IChannel, IClientChannel, IOutputChannel, IRequestChannel, IServiceChannel, IDuplexContextChannel
public class ServiceChannelProxy : DispatchProxy, ICommunicationObject, IChannel, IClientChannel, IOutputChannel, IRequestChannel, IServiceChannel, IDuplexContextChannel, IAsyncDisposable
{
private const String activityIdSlotName = "E2ETrace.ActivityID";
private Type _proxiedType;
Expand Down Expand Up @@ -673,6 +673,11 @@ void IDisposable.Dispose()
((IClientChannel)_serviceChannel).Dispose();
}

ValueTask IAsyncDisposable.DisposeAsync()
{
return ((IAsyncDisposable)_serviceChannel).DisposeAsync();
}

bool IContextChannel.AllowOutputBatching
{
get
Expand Down

0 comments on commit 614eaed

Please sign in to comment.