Exemplo n.º 1
0
 internal override void CreatePhysicalSNIHandle(string serverName, bool ignoreSniOpenTimeout, long timerExpire, out byte[] instanceName, ref byte[] spnBuffer, bool flushCache, bool async, bool parallel, string cachedFQDN, ref SQLDNSInfo pendingDNSInfo, bool isIntegratedSecurity)
 {
     _sessionHandle = SNIProxy.GetInstance().CreateConnectionHandle(this, serverName, ignoreSniOpenTimeout, timerExpire, out instanceName, ref spnBuffer, flushCache, async, parallel, isIntegratedSecurity, cachedFQDN, ref pendingDNSInfo);
     if (_sessionHandle == null)
     {
         _parser.ProcessSNIError(this);
     }
     else if (async)
     {
         // Create call backs and allocate to the session handle
         _sessionHandle.SetAsyncCallbacks(ReadAsyncCallback, WriteAsyncCallback);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="lowerHandle">Lower handle</param>
 public SNIMarsConnection(SNIHandle lowerHandle)
 {
     _sync          = new object();
     _connectionId  = Guid.NewGuid();
     _sessions      = new Dictionary <int, SNIMarsHandle>();
     _demuxState    = DemuxState.Header;
     _headerCount   = 0;
     _headerBytes   = new byte[SNISMUXHeader.HEADER_LENGTH];
     _nextSessionId = 0;
     _lowerHandle   = lowerHandle;
     SqlClientEventSource.Log.TrySNITraceEvent(nameof(SNIMarsConnection), EventType.INFO, "Created MARS Session Id {0}", args0: ConnectionId);
     _lowerHandle.SetAsyncCallbacks(HandleReceiveComplete, HandleSendComplete);
 }
 internal override void CreatePhysicalSNIHandle(string serverName, bool ignoreSniOpenTimeout, long timerExpire, out byte[] instanceName, ref byte[] spnBuffer, bool flushCache, bool async, bool parallel, bool isIntegratedSecurity)
 {
     _sessionHandle = SNIProxy.Singleton.CreateConnectionHandle(this, serverName, ignoreSniOpenTimeout, timerExpire, out instanceName, ref spnBuffer, flushCache, async, parallel, isIntegratedSecurity);
     if (_sessionHandle == null)
     {
         _parser.ProcessSNIError(this);
     }
     else if (async)
     {
         // Create call backs and allocate to the session handle
         SNIAsyncCallback ReceiveAsyncCallbackDispatcher = new SNIAsyncCallback(ReadAsyncCallback);
         SNIAsyncCallback SendAsyncCallbackDispatcher    = new SNIAsyncCallback(WriteAsyncCallback);
         _sessionHandle.SetAsyncCallbacks(ReceiveAsyncCallbackDispatcher, SendAsyncCallbackDispatcher);
     }
 }
Exemplo n.º 4
0
 internal override void CreatePhysicalSNIHandle(string serverName, bool ignoreSniOpenTimeout, long timerExpire, out byte[] instanceName, ref byte[][] spnBuffer, bool flushCache, bool async, bool parallel, string cachedFQDN, ref SQLDNSInfo pendingDNSInfo, bool isIntegratedSecurity)
 {
     _sessionHandle = SNIProxy.GetInstance().CreateConnectionHandle(serverName, ignoreSniOpenTimeout, timerExpire, out instanceName, ref spnBuffer, flushCache, async, parallel, isIntegratedSecurity, cachedFQDN, ref pendingDNSInfo);
     if (_sessionHandle == null)
     {
         _parser.ProcessSNIError(this);
     }
     else
     {
         SqlClientEventSource.Log.TryTraceEvent("TdsParserStateObjectManaged.CreatePhysicalSNIHandle | Info | State Object Id {0}, Session Id {1}, ServerName {2}, Async = {3}", _objectID, _sessionHandle?.ConnectionId, serverName, async);
         if (async)
         {
             // Create call backs and allocate to the session handle
             _sessionHandle.SetAsyncCallbacks(ReadAsyncCallback, WriteAsyncCallback);
         }
     }
 }
Exemplo n.º 5
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="lowerHandle">Lower handle</param>
 public SNIMarsConnection(SNIHandle lowerHandle)
 {
     _lowerHandle = lowerHandle;
     _lowerHandle.SetAsyncCallbacks(HandleReceiveComplete, HandleSendComplete);
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="lowerHandle">Lower handle</param>
 public SNIMarsConnection(SNIHandle lowerHandle)
 {
     _lowerHandle = lowerHandle;
     SqlClientEventSource.Log.TrySNITraceEvent(s_className, EventType.INFO, "Created MARS Session Id {0}", args0: ConnectionId);
     _lowerHandle.SetAsyncCallbacks(HandleReceiveComplete, HandleSendComplete);
 }