/// <summary> /// Creates the specified server protocol configuration. /// Use this method for FaultTolerance : None & HotStandby /// </summary> /// <param name="uri">Server uri.</param> /// <param name="userName">Name of the application user.</param> /// <param name="faultTolerance">The fault tolerance mode.</param> public void Create(Uri serverUri, string userName, FaultToleranceMode faultTolerance) { Protocolconfiguration = null; Protocolconfiguration = new TServerConfiguration(ServerType.Tserver.ToString()); Protocolconfiguration.Uri = serverUri; Protocolconfiguration.ClientName = "AID_" + userName; Protocolconfiguration.FaultTolerance = faultTolerance; }
/// <summary> /// Creates the specified server protocol configuration. /// Use this method for FaultTolerance : WarmStandby /// Warm standby switch over is set to unlimited time. /// </summary> /// <param name="uri">Server uri.</param> /// <param name="userName">Name of the application user.</param> /// <param name="warmStandbyUri">Warm standby URI.</param> /// <param name="warmStandByTimeOut">Warm stand by time out.</param> /// <param name="warmStandByAttempts">Warm stand by attempts.</param> public void Create(Uri serverUri, string userName, Uri warmStandbyUri, Int32 warmStandByTimeOut, Int16 warmStandByAttempts) { Protocolconfiguration = null; Protocolconfiguration = new TServerConfiguration(ServerType.Tserver.ToString()); Protocolconfiguration.Uri = serverUri; Protocolconfiguration.ClientName = "AID_" + userName; Protocolconfiguration.FaultTolerance = FaultToleranceMode.WarmStandby; Protocolconfiguration.WarmStandbyUri = warmStandbyUri; Protocolconfiguration.WarmStandbyTimeout = warmStandByTimeOut; Protocolconfiguration.WarmStandbyAttempts = warmStandByAttempts; }
/// <summary> /// Creates the specified server protocol configuration. /// Use this method for FaultTolerance : None & HotStandby /// </summary> /// <param name="serverUri">The server URI.</param> /// <param name="userName">Name of the user.</param> /// <param name="faultTolerance">The fault tolerance.</param> /// <param name="addpServerTimeOut">Addp server time out.</param> /// <param name="addpClientTimeOut">Addp client time out.</param> /// <param name="addpTrace">Addp trace mode.</param> public void Create(Uri serverUri, string userName, FaultToleranceMode faultTolerance, Int32 addpServerTimeOut, Int32 addpClientTimeOut, AddpTraceMode addpTrace) { Protocolconfiguration = null; Protocolconfiguration = new TServerConfiguration(ServerType.Tserver.ToString()); Protocolconfiguration.Uri = serverUri; Protocolconfiguration.ClientName = "AID_" + userName; Protocolconfiguration.FaultTolerance = faultTolerance; Protocolconfiguration.UseAddp = true; Protocolconfiguration.AddpServerTimeout = addpServerTimeOut; Protocolconfiguration.AddpClientTimeout = addpClientTimeOut; Protocolconfiguration.AddpTrace = addpTrace.ToString(); }
/// <summary> /// Creates the specified server types. /// </summary> public void Create() { Protocolconfiguration = null; Protocolconfiguration = new TServerConfiguration(ServerType.Tserver.ToString()); }
public void InicializaComunicacao() { try { //Create Protocol Manager Service object pmsTServer = new ProtocolManagementService(); //Create and initialize connection configuration object for TServer TServerConfiguration tsc = new TServerConfiguration(TSERVER_IDENTIFIER); tsc.Uri = new Uri(TSERVER_URI); tsc.ClientName = TSERVER_CLIENT_NAME; tsc.ClientPassword = GENESYS_PASSWORD; pmsTServer.Register(tsc); pmsTServer.ProtocolOpened += new EventHandler<ProtocolEventArgs>(this.onProtocolOpenedTServer); pmsTServer.ProtocolClosed += new EventHandler<ProtocolEventArgs>(this.onProtocolClosedTServer); IProtocol p = pmsTServer[TSERVER_IDENTIFIER]; p.Received += TServerEventsHandler; if (p.State == ChannelState.Closed) { p.BeginOpen(); Thread.Sleep(3000); } else { EnviaMensagemSignalR("ServidorCTI-Erro", "InicializaComunicacao(...) - falha 001 - estado do protocolo: " + p.State); } pmsTServer[TSERVER_IDENTIFIER].CopyResponse = true; RegistraPlace(this.PA); } catch (Exception ex) { EnviaMensagemSignalR("ServidorCTI-Erro", "InicializaComunicacao(...) - exception: " + ex.Message); } }