internal void AbortSocket(bool isAbortState)
{
// The timer/finalization thread is allowed to call this. (It doesn't call user code and doesn't block.)
GlobalLog.ThreadContract(ThreadKinds.Unknown, ThreadKinds.SafeSources | ThreadKinds.Timer | ThreadKinds.Finalization, "Connection#" + ValidationHelper.HashString(this) + "::AbortSocket");
GlobalLog.Enter("Connection#" + ValidationHelper.HashString(this) + "::Abort", "isAbortState:" + isAbortState.ToString());
if (isAbortState) {
UnlockRequest();
CheckIdle();
}
else {
// This one is recoverable, set it to keep Read/Write StartNextRequest happy.
m_Error = WebExceptionStatus.KeepAliveFailure;
}
// Stream close isn't threadsafe.
lock (this)
{
Close(0);
}
GlobalLog.Leave("Connection#" + ValidationHelper.HashString(this) + "::Abort", "isAbortState:" + isAbortState.ToString());
}