예제 #1
0
 public override void CancelOperation(int kind)
 {
     try
     {
         SendCancelOperationToBuffer(kind);
         XdrStream.Flush();
         // no response, this is async
     }
     catch (IOException ex)
     {
         throw IscException.ForErrorCode(IscCodes.isc_network_error, ex);
     }
 }
        public override void CreateDatabaseWithTrustedAuth(DatabaseParameterBuffer dpb, string dataSource, int port, string database, byte[] cryptKey)
        {
            using (var sspiHelper = new SspiHelper())
            {
                var authData = sspiHelper.InitializeClientSecurity();
                SendTrustedAuthToBuffer(dpb, authData);
                SendCreateToBuffer(dpb, database);
                XdrStream.Flush();

                var response = ReadResponse();
                ProcessTrustedAuthResponse(sspiHelper, ref response);
                ProcessCreateResponse((GenericResponse)response);
            }
        }
 public override void CreateDatabase(DatabaseParameterBuffer dpb, string dataSource, int port, string database, byte[] cryptKey)
 {
     try
     {
         SendCreateToBuffer(dpb, database);
         XdrStream.Flush();
         var response = ReadResponse();
         response = ProcessCryptCallbackResponseIfNeeded(response, cryptKey);
         ProcessCreateResponse(response as GenericResponse);
     }
     catch (IOException ex)
     {
         throw IscException.ForErrorCode(IscCodes.isc_network_error, ex);
     }
 }
        public override void Attach(DatabaseParameterBuffer dpb, string dataSource, int port, string database, byte[] cryptKey)
        {
            try
            {
                SendAttachToBuffer(dpb, database);
                XdrStream.Flush();
                var response = ReadResponse();
                response = ProcessCryptCallbackResponseIfNeeded(response, cryptKey);
                ProcessAttachResponse(response as GenericResponse);
            }
            catch (IscException)
            {
                SafelyDetach();
                throw;
            }
            catch (IOException ex)
            {
                SafelyDetach();
                throw IscException.ForErrorCode(IscCodes.isc_net_write_err, ex);
            }

            AfterAttachActions();
        }