• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# SqlClient.SNIHandle类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Data.SqlClient.SNIHandle的典型用法代码示例。如果您正苦于以下问题:C# SNIHandle类的具体用法?C# SNIHandle怎么用?C# SNIHandle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SNIHandle类属于System.Data.SqlClient命名空间,在下文中一共展示了SNIHandle类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: BestEffortCleanup

 internal static void BestEffortCleanup(SNIHandle target)
 {
     if (target != null)
     {
         target.Dispose();
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:SqlInternalConnection.cs


示例2: SNIHandle

 internal SNIHandle(SNINativeMethodWrapper.ConsumerInfo myInfo, string serverName, SNIHandle parent) : base(IntPtr.Zero, true)
 {
     this._status = uint.MaxValue;
     RuntimeHelpers.PrepareConstrainedRegions();
     try
     {
     }
     finally
     {
         this._status = SNINativeMethodWrapper.SNIOpen(myInfo, serverName, parent, ref this.handle, parent._fSync);
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:12,代码来源:SNIHandle.cs


示例3: TdsParserStateObject

 internal TdsParserStateObject(TdsParser parser, SNIHandle physicalConnection, bool async)
 {
     this._objectID = Interlocked.Increment(ref _objectTypeCount);
     this._owner = new WeakReference(null);
     this._inputHeaderLen = 8;
     this._outputHeaderLen = 8;
     this._outBytesUsed = 8;
     this._outputPacketNumber = 1;
     this._bTmp = new byte[12];
     this._parser = parser;
     this.SniContext = System.Data.SqlClient.SniContext.Snix_GetMarsSession;
     this.SetPacketSize(this._parser._physicalStateObj._outBuff.Length);
     SNINativeMethodWrapper.ConsumerInfo myInfo = this.CreateConsumerInfo(async);
     this._sessionHandle = new SNIHandle(myInfo, "session:", physicalConnection);
     if (this._sessionHandle.Status != 0)
     {
         parser.Errors.Add(parser.ProcessSNIError(this));
         parser.ThrowExceptionAndWarning();
     }
     this.IncrementPendingCallbacks();
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:21,代码来源:TdsParserStateObject.cs


示例4: SNIWritePacket

 internal static uint SNIWritePacket(SNIHandle pConn, SNIPacket packet, bool sync)
 {
     if (sync)
     {
         return SNIWriteSyncOverAsync(pConn, packet);
     }
     else
     {
         return SNIWriteAsyncWrapper(pConn, packet);
     }
 }
开发者ID:swaroop-sridhar,项目名称:corefx,代码行数:11,代码来源:SNINativeMethodWrapper.Windows.cs


示例5: SNISecGenClientContext

 internal static unsafe uint SNISecGenClientContext(SNIHandle pConnectionObject, byte[] inBuff, uint receivedLength, byte[] OutBuff, ref uint sendLength, byte[] serverUserName)
 {
     fixed (byte* pin_serverUserName = &serverUserName[0])
     {
         bool local_fDone;
         return SNISecGenClientContextWrapper(
             pConnectionObject,
             inBuff,
             receivedLength,
             OutBuff,
             ref sendLength,
             out local_fDone,
             pin_serverUserName,
             (uint)(serverUserName == null ? 0 : serverUserName.Length),
             null,
             null);
     }
 }
开发者ID:swaroop-sridhar,项目名称:corefx,代码行数:18,代码来源:SNINativeMethodWrapper.Windows.cs


示例6: SNIOpenMarsSession

		public static uint SNIOpenMarsSession (ConsumerInfo info, SNIHandle parent, ref IntPtr handle, bool sync)
		{
			throw new NotSupportedException (msg);
		}
开发者ID:Profit0004,项目名称:mono,代码行数:4,代码来源:SNINativeMethodWrapper.cs


示例7: CreatePhysicalSNIHandle

        internal void CreatePhysicalSNIHandle(string serverName, bool ignoreSniOpenTimeout, long timerExpire, out byte[] instanceName, byte[] spnBuffer, bool flushCache, bool async, bool fParallel)
        {
            SNINativeMethodWrapper.ConsumerInfo myInfo = CreateConsumerInfo(async);

            // Translate to SNI timeout values (Int32 milliseconds)
            long timeout;
            if (Int64.MaxValue == timerExpire)
            {
                timeout = Int32.MaxValue;
            }
            else
            {
                timeout = ADP.TimerRemainingMilliseconds(timerExpire);
                if (timeout > Int32.MaxValue)
                {
                    timeout = Int32.MaxValue;
                }
                else if (0 > timeout)
                {
                    timeout = 0;
                }
            }

            _sessionHandle = new SNIHandle(myInfo, serverName, spnBuffer, ignoreSniOpenTimeout, checked((int)timeout), out instanceName, flushCache, !async, fParallel);
        }
开发者ID:nnyamhon,项目名称:corefx,代码行数:25,代码来源:TdsParserStateObject.cs


示例8: TdsParserStateObject

        internal TdsParserStateObject(TdsParser parser, SNIHandle physicalConnection, bool async)
        {
            // Construct a MARS session
            Debug.Assert(null != parser, "no parser?");
            _parser = parser;
            SniContext = SniContext.Snix_GetMarsSession;

            Debug.Assert(null != _parser._physicalStateObj, "no physical session?");
            Debug.Assert(null != _parser._physicalStateObj._inBuff, "no in buffer?");
            Debug.Assert(null != _parser._physicalStateObj._outBuff, "no out buffer?");
            Debug.Assert(_parser._physicalStateObj._outBuff.Length ==
                         _parser._physicalStateObj._inBuff.Length, "Unexpected unequal buffers.");

            // Determine packet size based on physical connection buffer lengths.
            SetPacketSize(_parser._physicalStateObj._outBuff.Length);

            SNINativeMethodWrapper.ConsumerInfo myInfo = CreateConsumerInfo(async);
            _sessionHandle = new SNIHandle(myInfo, physicalConnection);

            if (_sessionHandle.Status != TdsEnums.SNI_SUCCESS)
            {
                AddError(parser.ProcessSNIError(this));
                ThrowExceptionAndWarning();
            }

            // we post a callback that represents the call to dispose; once the
            // object is disposed, the next callback will cause the GC Handle to
            // be released.
            IncrementPendingCallbacks();
            _lastSuccessfulIOTimer = parser._physicalStateObj._lastSuccessfulIOTimer;
        }
开发者ID:nnyamhon,项目名称:corefx,代码行数:31,代码来源:TdsParserStateObject.cs


示例9: SNIHandle

 // constructs SNI Handle for MARS session
 internal SNIHandle(SNINativeMethodWrapper.ConsumerInfo myInfo, SNIHandle parent) : base(IntPtr.Zero, true) {
     RuntimeHelpers.PrepareConstrainedRegions();
     try {} finally {          
         _status = SNINativeMethodWrapper.SNIOpenMarsSession(myInfo, parent, ref base.handle, parent._fSync);
     }
 }
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:7,代码来源:TdsParserSafeHandles.cs


示例10: SNIRemoveProvider

 internal static extern uint SNIRemoveProvider(SNIHandle pConn, ProviderEnum ProvNum);
开发者ID:swaroop-sridhar,项目名称:corefx,代码行数:1,代码来源:SNINativeMethodWrapper.Windows.cs


示例11: SNIReadSyncOverAsync

 internal static extern uint SNIReadSyncOverAsync(SNIHandle pConn, ref IntPtr ppNewPacket, int timeout);
开发者ID:swaroop-sridhar,项目名称:corefx,代码行数:1,代码来源:SNINativeMethodWrapper.Windows.cs


示例12: SNIReadAsync

 internal static extern uint SNIReadAsync(SNIHandle pConn, ref IntPtr ppNewPacket);
开发者ID:swaroop-sridhar,项目名称:corefx,代码行数:1,代码来源:SNINativeMethodWrapper.Windows.cs


示例13: SNIAddProvider

 internal static extern uint SNIAddProvider(SNIHandle pConn, ProviderEnum ProvNum, [In] ref uint pInfo);
开发者ID:swaroop-sridhar,项目名称:corefx,代码行数:1,代码来源:SNINativeMethodWrapper.Windows.cs


示例14: SNIHandle

 // constructs SNI Handle for MARS session
 internal SNIHandle(SNINativeMethodWrapper.ConsumerInfo myInfo, SNIHandle parent) : base(IntPtr.Zero, true)
 {
     try { }
     finally
     {
         _status = SNINativeMethodWrapper.SNIOpenMarsSession(myInfo, parent, ref base.handle, parent._fSync);
     }
 }
开发者ID:nnyamhon,项目名称:corefx,代码行数:9,代码来源:TdsParserSafeHandles.cs


示例15: SNIWriteAsync

 private uint SNIWriteAsync(SNIHandle handle, SNIPacket packet, DbAsyncResult asyncResult)
 {
     uint num;
     RuntimeHelpers.PrepareConstrainedRegions();
     try
     {
     }
     finally
     {
         this.IncrementPendingCallbacks();
         num = SNINativeMethodWrapper.SNIWriteAsync(handle, packet);
         if ((num == 0) || (num != 0x3e5))
         {
             this.DecrementPendingCallbacks(false);
         }
     }
     if (num != 0)
     {
         if (num != 0x3e5)
         {
             Bid.Trace("<sc.TdsParser.WritePacket|Info> write async returned error code %d\n", (int) num);
             this._parser.Errors.Add(this._parser.ProcessSNIError(this));
             this.ThrowExceptionAndWarning();
             return num;
         }
         if (num != 0x3e5)
         {
             return num;
         }
         try
         {
             ((IAsyncResult) asyncResult).AsyncWaitHandle.WaitOne();
             if (this._error != null)
             {
                 this._parser.Errors.Add(this._error);
                 this._error = null;
                 Bid.Trace("<sc.TdsParser.WritePacket|Info> write async returned error code %d\n", (int) num);
                 this.ThrowExceptionAndWarning();
             }
         }
         finally
         {
             asyncResult.Reset();
         }
     }
     return num;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:47,代码来源:TdsParserStateObject.cs


示例16: CreatePhysicalSNIHandle

 internal void CreatePhysicalSNIHandle(string serverName, bool ignoreSniOpenTimeout, long timerExpire, out byte[] instanceName, byte[] spnBuffer, bool flushCache, bool async, bool fParallel)
 {
     long num;
     SNINativeMethodWrapper.ConsumerInfo myInfo = this.CreateConsumerInfo(async);
     if (0x7fffffffffffffffL == timerExpire)
     {
         num = 0x7fffffffL;
     }
     else
     {
         num = ADP.TimerRemainingMilliseconds(timerExpire);
         if (num > 0x7fffffffL)
         {
             num = 0x7fffffffL;
         }
         else if (0L > num)
         {
             num = 0L;
         }
     }
     this._sessionHandle = new SNIHandle(myInfo, serverName, spnBuffer, ignoreSniOpenTimeout, (int) num, out instanceName, flushCache, !async, fParallel);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:22,代码来源:TdsParserStateObject.cs


示例17: SNISetInfo

 internal static extern uint SNISetInfo(SNIHandle pConn, QTypes QType, [In] ref uint pbQInfo);
开发者ID:swaroop-sridhar,项目名称:corefx,代码行数:1,代码来源:SNINativeMethodWrapper.Windows.cs


示例18: SNIWriteAsyncWrapper

 private static extern uint SNIWriteAsyncWrapper(SNIHandle pConn, [In] SNIPacket pPacket);
开发者ID:swaroop-sridhar,项目名称:corefx,代码行数:1,代码来源:SNINativeMethodWrapper.Windows.cs


示例19: SNIWriteSyncOverAsync

 private static extern uint SNIWriteSyncOverAsync(SNIHandle pConn, [In] SNIPacket pPacket);
开发者ID:swaroop-sridhar,项目名称:corefx,代码行数:1,代码来源:SNINativeMethodWrapper.Windows.cs


示例20: Take

 public SNIPacket Take(SNIHandle sniHandle) {
     SNIPacket packet;
     if (_packets.Count > 0) {
         // Success - reset the packet
         packet = _packets.Pop();
         SNINativeMethodWrapper.SNIPacketReset(sniHandle, SNINativeMethodWrapper.IOType.WRITE, packet, SNINativeMethodWrapper.ConsumerNumber.SNI_Consumer_SNI);
     }
     else {
         // Failed to take a packet - create a new one
         packet = new SNIPacket(sniHandle);
     }
     return packet;
 }
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:13,代码来源:TdsParserSafeHandles.cs



注:本文中的System.Data.SqlClient.SNIHandle类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# SqlClient.SqlBuffer类代码示例发布时间:2022-05-26
下一篇:
C# SqlClient.MetaType类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap