Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ WriteAsyncInternal< TIOAdapter >()

async ValueTask System.Net.Security.SslStream.WriteAsyncInternal< TIOAdapter > ( TIOAdapter writeAdapter,
ReadOnlyMemory< byte > buffer )
inlineprivate
Type Constraints
TIOAdapter :struct 
TIOAdapter :IReadWriteAdapter 

Definition at line 1696 of file SslStream.cs.

1696 : struct, IReadWriteAdapter
1697 {
1699 _ = buffer.Length;
1700 if (Interlocked.Exchange(ref _nestedWrite, 1) == 1)
1701 {
1702 throw new NotSupportedException(System.SR.Format(System.SR.net_io_invalidnestedcall, "WriteAsync", "write"));
1703 }
1704 try
1705 {
1706 await ((buffer.Length < MaxDataSize) ? WriteSingleChunk(writeAdapter, buffer) : WriteAsyncChunked(writeAdapter, buffer)).ConfigureAwait(continueOnCapturedContext: false);
1707 }
1708 catch (Exception ex)
1709 {
1710 if (ex is IOException || (ex is OperationCanceledException && writeAdapter.CancellationToken.IsCancellationRequested))
1711 {
1712 throw;
1713 }
1714 throw new IOException(System.SR.net_io_write, ex);
1715 }
1716 finally
1717 {
1718 _nestedWrite = 0;
1719 }
1720 }
void ThrowIfExceptionalOrNotAuthenticatedOrShutdown()
Definition SslStream.cs:886
static string net_io_invalidnestedcall
Definition SR.cs:24
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string net_io_write
Definition SR.cs:38
Definition SR.cs:7
static int Exchange(ref int location1, int value)

References System.Net.Security.SslStream._nestedWrite, System.buffer, System.OperationCanceledException.CancellationToken, System.Threading.Interlocked.Exchange(), System.SR.Format(), System.Threading.CancellationToken.IsCancellationRequested, System.Net.Security.SslStream.MaxDataSize, System.SR.net_io_invalidnestedcall, System.SR.net_io_write, and System.Net.Security.SslStream.ThrowIfExceptionalOrNotAuthenticatedOrShutdown().