From 040cb5d258b14a3543f3d24bde1dc0e12436fd94 Mon Sep 17 00:00:00 2001 From: "Alecio Furanze (Ale)" Date: Tue, 18 Jun 2024 13:28:59 +0200 Subject: [PATCH] implement HTTP.ClientTo->Close --- src/http/partials/Client/HTTP.ClientTo.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/http/partials/Client/HTTP.ClientTo.cs b/src/http/partials/Client/HTTP.ClientTo.cs index b99a5582..4895b237 100644 --- a/src/http/partials/Client/HTTP.ClientTo.cs +++ b/src/http/partials/Client/HTTP.ClientTo.cs @@ -128,6 +128,11 @@ public Task Open(string method, string url, string body, Encoding encode) return Open(method, url, body.GetBytes(encode)); } + public Task Close() + { + _cancellationToken.Cancel(throwOnFirstException: true); + return Task.CompletedTask; + } public int GetTimeout() { @@ -154,11 +159,6 @@ public void SetTimeout(int timeout) _timeout = timeout; } - public Task Close() - { - // TODO: impl it - throw new NotImplementedException(); - } private class BodyContent : HttpContent { private readonly byte[] _buffer;