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

◆ AuthenticateAsync< TAdapter >()

async Task System.Net.Security.NegotiateStream.AuthenticateAsync< TAdapter > ( TAdapter adapter,
[CallerMemberName] string callerName = null )
inlineprivate
Type Constraints
TAdapter :IReadWriteAdapter 

Definition at line 802 of file NegotiateStream.cs.

802 : IReadWriteAdapter
803 {
804 ThrowIfFailed(authSuccessCheck: false);
805 if (Interlocked.Exchange(ref _authInProgress, 1) == 1)
806 {
807 throw new InvalidOperationException(System.SR.Format(System.SR.net_io_invalidnestedcall, callerName, "authenticate"));
808 }
809 try
810 {
811 await (_context.IsServer ? ReceiveBlobAsync(adapter) : SendBlobAsync(adapter, null)).ConfigureAwait(continueOnCapturedContext: false);
812 }
813 catch (Exception failed)
814 {
815 SetFailed(failed);
816 throw;
817 }
818 finally
819 {
820 _authInProgress = 0;
821 }
822 }
void ThrowIfFailed(bool authSuccessCheck)
static string net_io_invalidnestedcall
Definition SR.cs:24
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
Definition SR.cs:7
static int Exchange(ref int location1, int value)

References System.Net.Security.NegotiateStream._authInProgress, System.Net.Security.NegotiateStream._context, System.Threading.Interlocked.Exchange(), System.SR.Format(), System.Net.NTAuthentication.IsServer, System.SR.net_io_invalidnestedcall, System.Net.Security.NegotiateStream.SetFailed(), and System.Net.Security.NegotiateStream.ThrowIfFailed().