/// <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)); }
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); }
/// <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; } }
/// <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); } }