public void Start(string sessionName) { var version = _version; if (version == FbTraceVersion.Detect) { version = DetectVersion(); } try { var config = string.Join(Environment.NewLine, DatabasesConfigurations.BuildConfiguration(version), ServiceConfiguration?.BuildConfiguration(version) ?? string.Empty); StartSpb = new ServiceParameterBuffer(); StartSpb.Append(IscCodes.isc_action_svc_trace_start); if (!string.IsNullOrEmpty(sessionName)) { StartSpb.Append(IscCodes.isc_spb_trc_name, sessionName); } StartSpb.Append(IscCodes.isc_spb_trc_cfg, config); Open(); StartTask(); ProcessServiceOutput(); } catch (Exception ex) { throw new FbException(ex.Message, ex); } finally { Close(); } }
public void Start(string sessionName) { try { string config = DatabasesConfigurations.ToString() + (ServiceConfiguration != null ? ServiceConfiguration.ToString() : string.Empty); StartSpb = new ServiceParameterBuffer(); StartSpb.Append(IscCodes.isc_action_svc_trace_start); if (!string.IsNullOrEmpty(sessionName)) { StartSpb.Append(IscCodes.isc_spb_trc_name, sessionName); } StartSpb.Append(IscCodes.isc_spb_trc_cfg, config); Open(); StartTask(); ProcessServiceOutput(); } catch (Exception ex) { throw new FbException(ex.Message, ex); } finally { Close(); } }
private async Task StartImpl(string sessionName, AsyncWrappingCommonArgs async) { var version = _version; if (version == FbTraceVersion.Detect) { version = DetectVersion(); } try { var config = string.Join(Environment.NewLine, DatabasesConfigurations.BuildConfiguration(version), ServiceConfiguration?.BuildConfiguration(version) ?? string.Empty); await Open(async).ConfigureAwait(false); var startSpb = new ServiceParameterBuffer(); startSpb.Append(IscCodes.isc_action_svc_trace_start); if (!string.IsNullOrEmpty(sessionName)) { startSpb.Append(IscCodes.isc_spb_trc_name, sessionName); } startSpb.Append(IscCodes.isc_spb_trc_cfg, config); await StartTask(startSpb, async).ConfigureAwait(false); await ProcessServiceOutput(EmptySpb, async).ConfigureAwait(false); } catch (Exception ex) { throw new FbException(ex.Message, ex); } finally { await Close(async).ConfigureAwait(false); } }
public async Task StartAsync(string sessionName, CancellationToken cancellationToken = default) { var version = _version; if (version == FbTraceVersion.Detect) { version = await DetectVersionAsync(cancellationToken).ConfigureAwait(false); } try { var config = string.Join(Environment.NewLine, DatabasesConfigurations.BuildConfiguration(version), ServiceConfiguration?.BuildConfiguration(version) ?? string.Empty); await OpenAsync(cancellationToken).ConfigureAwait(false); var startSpb = new ServiceParameterBuffer2(); startSpb.Append(IscCodes.isc_action_svc_trace_start); if (!string.IsNullOrEmpty(sessionName)) { startSpb.Append2(IscCodes.isc_spb_trc_name, sessionName); } startSpb.Append2(IscCodes.isc_spb_trc_cfg, config); await StartTaskAsync(startSpb, cancellationToken).ConfigureAwait(false); await ProcessServiceOutputAsync(ServiceParameterBufferBase.Empty, cancellationToken).ConfigureAwait(false); } catch (Exception ex) { throw FbException.Create(ex); } finally { await CloseAsync(cancellationToken).ConfigureAwait(false); } }