Ejemplo 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));
        }
Ejemplo n.º 2
0
        internal override uint EnableMars(ref uint info)
        {
            _marsConnection = new SNIMarsConnection(Handle);
            if (_marsConnection.StartReceive() == TdsEnums.SNI_SUCCESS_IO_PENDING)
            {
                return(TdsEnums.SNI_SUCCESS);
            }

            return(TdsEnums.SNI_ERROR);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Create a MARS connection
        /// </summary>
        /// <param name="lowerHandle">Lower SNI handle</param>
        /// <returns>SNI error code</returns>
        public uint CreateMarsConnection(SNIHandle lowerHandle)
        {
            SNIMarsConnection connection = new SNIMarsConnection(lowerHandle);

            if (_connections.TryAdd(lowerHandle, connection))
            {
                return connection.StartReceive();
            }
            else
            {
                return TdsEnums.SNI_ERROR;
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Create a MARS connection
        /// </summary>
        /// <param name="lowerHandle">Lower SNI handle</param>
        /// <returns>SNI error code</returns>
        public uint CreateMarsConnection(SNIHandle lowerHandle)
        {
            SNIMarsConnection connection = new SNIMarsConnection(lowerHandle);

            if (_connections.TryAdd(lowerHandle, connection))
            {
                return(connection.StartReceive());
            }
            else
            {
                return(TdsEnums.SNI_ERROR);
            }
        }