未验证 提交 54679f4b 编写于 作者: G github-actions[bot] 提交者: GitHub

Added missing *Async overrides to TlsStream (#91794)

Co-authored-by: NManicka <manicka@Manickas-MacBook-Pro.local>
上级 e9464f75
......@@ -5,6 +5,8 @@
using System.Net.Sockets;
using System.Security.Authentication;
using System.Security.Cryptography.X509Certificates;
using System.Threading;
using System.Threading.Tasks;
namespace System.Net
{
......@@ -46,6 +48,11 @@ public void EndAuthenticateAsClient(IAsyncResult asyncResult)
_sslStream.EndAuthenticateAsClient(asyncResult);
}
public override void Write(byte[] buffer, int offset, int size)
{
_sslStream.Write(buffer, offset, size);
}
public override IAsyncResult BeginWrite(byte[] buffer, int offset, int size, AsyncCallback? callback, object? state)
{
return _sslStream.BeginWrite(buffer, offset, size, callback, state);
......@@ -56,9 +63,9 @@ public override void EndWrite(IAsyncResult result)
_sslStream.EndWrite(result);
}
public override void Write(byte[] buffer, int offset, int size)
public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
{
_sslStream.Write(buffer, offset, size);
return _sslStream.WriteAsync(buffer, offset, count, cancellationToken);
}
public override int Read(byte[] buffer, int offset, int size)
......@@ -66,6 +73,11 @@ public override int Read(byte[] buffer, int offset, int size)
return _sslStream.Read(buffer, offset, size);
}
public override Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
{
return _sslStream.ReadAsync(buffer, offset, count, cancellationToken);
}
public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback? callback, object? state)
{
return _sslStream.BeginRead(buffer, offset, count, callback, state);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册