本文整理汇总了C#中System.Data.SqlClient.TdsParserStateObject.DecrementPendingCallbacks方法的典型用法代码示例。如果您正苦于以下问题:C# TdsParserStateObject.DecrementPendingCallbacks方法的具体用法?C# TdsParserStateObject.DecrementPendingCallbacks怎么用?C# TdsParserStateObject.DecrementPendingCallbacks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Data.SqlClient.TdsParserStateObject
的用法示例。
在下文中一共展示了TdsParserStateObject.DecrementPendingCallbacks方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadSni
internal void ReadSni(DbAsyncResult asyncResult, TdsParserStateObject stateObj)
{
if ((this._parser.State != TdsParserState.Broken) && (this._parser.State != TdsParserState.Closed))
{
IntPtr zero = IntPtr.Zero;
RuntimeHelpers.PrepareConstrainedRegions();
try
{
uint num;
if (!this._parser.AsyncOn)
{
num = SNINativeMethodWrapper.SNIReadSync(stateObj.Handle, ref zero, TdsParserStaticMethods.GetTimeoutMilliseconds(stateObj.TimeoutTime));
if (num == 0)
{
stateObj.ProcessSniPacket(zero, 0);
}
else
{
this.ReadSniError(stateObj, num);
}
}
else
{
stateObj._asyncResult = asyncResult;
RuntimeHelpers.PrepareConstrainedRegions();
try
{
}
finally
{
stateObj.IncrementPendingCallbacks();
num = SNINativeMethodWrapper.SNIReadAsync(stateObj.Handle, ref zero);
if ((num != 0) && (0x3e5 != num))
{
stateObj.DecrementPendingCallbacks(false);
}
}
if (num == 0)
{
stateObj._asyncResult.SetCompletedSynchronously();
stateObj.ReadAsyncCallback(ADP.PtrZero, zero, 0);
}
else if (0x3e5 != num)
{
this.ReadSniError(stateObj, num);
}
}
}
finally
{
if (zero != IntPtr.Zero)
{
SNINativeMethodWrapper.SNIPacketRelease(zero);
}
}
}
}