Exemplo n.º 1
0
        /// <summary>
        /// Enables MARS for a TdsParserStateObject and returns its new handle.
        /// </summary>
        public static SNIMarsHandle EnableMars(TdsParserStateObject stateObject, out SNIError sniError)
        {
            Debug.Assert(!(stateObject.Handle is SNIMarsHandle), "Cannot enable MARS on a SNIMarsHandle");
            SNIMarsConnection marsConnection = new SNIMarsConnection(stateObject.Handle);

            marsConnection.StartReceive();
            return(marsConnection.CreateSession(stateObject, out sniError));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Create MARS handle
        /// </summary>
        /// <param name="callbackObject">Asynchronous I/O callback object</param>
        /// <param name="physicalConnection">SNI connection handle</param>
        /// <param name="defaultBufferSize">Default buffer size</param>
        /// <param name="async">Asynchronous connection</param>
        /// <returns>SNI error status</returns>
        public SNIHandle CreateMarsHandle(object callbackObject, SNIHandle physicalConnection, int defaultBufferSize, bool async)
        {
            SNIMarsConnection connection = SNIMarsManager.Singleton.GetConnection(physicalConnection);

            return(connection.CreateSession(callbackObject, async));
        }
Exemplo n.º 3
0
 /// <summary>
 /// Creates a new MARS session.
 /// </summary>
 public override SNIHandle CreateSession(TdsParserStateObject callbackObject, out SNIError sniError)
 {
     return(_connection.CreateSession(callbackObject, out sniError));
 }