1384 : struct, IReadWriteAdapter
1385 {
1387 byte[] outBuffer =
array;
1388 SecurityStatusPal status;
1389 int outSize;
1390 while (true)
1391 {
1394 {
1395 break;
1396 }
1398 if (handshakeWaiter != null)
1399 {
1401 if (!
task.IsCompletedSuccessfully)
1402 {
1404 }
1405 }
1406 }
1408 {
1411 }
1412 ValueTask valueTask = writeAdapter.WriteAsync(outBuffer, 0, outSize);
1414 {
1416 return valueTask;
1417 }
1418 return CompleteWriteAsync(valueTask,
array);
1419 static async
ValueTask CompleteWriteAsync(
ValueTask writeTask,
byte[] bufferToReturn)
1420 {
1421 try
1422 {
1423 await writeTask.
ConfigureAwait(continueOnCapturedContext: false);
1424 }
1425 finally
1426 {
1428 }
1429 }
1430 async
ValueTask WaitAndWriteAsync(TIOAdapter writeAdapter, ReadOnlyMemory<byte>
buffer,
Task waitTask,
byte[] rentedBuffer)
1431 {
1432 byte[] bufferToReturn2 = rentedBuffer;
1433 byte[] outBuffer2 = rentedBuffer;
1434 try
1435 {
1437 int outSize2;
1440 {
1441 byte[] array2 = bufferToReturn2;
1442 bufferToReturn2 = null;
1444 await WriteSingleChunk(writeAdapter,
buffer).ConfigureAwait(continueOnCapturedContext: false);
1445 }
1446 else
1447 {
1449 {
1451 }
1452 await writeAdapter.WriteAsync(outBuffer2, 0, outSize2).ConfigureAwait(continueOnCapturedContext: false);
1453 }
1454 }
1455 finally
1456 {
1457 if (bufferToReturn2 != null)
1458 {
1460 }
1461 }
1462 }
1463 }
static ArrayPool< T > Shared
SecurityStatusPal EncryptData(ReadOnlyMemory< byte > buffer, ref byte[] outBuffer, out int outSize)
volatile TaskCompletionSource< bool > _handshakeWaiter
static Exception SetCurrentStackTrace(Exception source)
static string net_io_encrypt
new ConfiguredTaskAwaitable< TResult > ConfigureAwait(bool continueOnCapturedContext)
new Task< TResult > WaitAsync(CancellationToken cancellationToken)
SecurityStatusPalErrorCode
bool IsCompletedSuccessfully
ConfiguredValueTaskAwaitable ConfigureAwait(bool continueOnCapturedContext)
static ValueTask FromException(Exception exception)