当前位置: 首页>>代码示例>>C#>>正文


C# SqlClient.SNIHandle类代码示例

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


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


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