/// <summary> /// Creates a new ClientReConnecter object. It is not needed to start ClientReConnecter since /// it automatically starts when the client disconnected. /// </summary> /// <param name="client">Reference to client object</param> /// <exception cref="ArgumentNullException"> /// Throws ArgumentNullException if client is null. /// </exception> public ClientReConnecter(IConnectableClient client) { _client = client ?? throw new ArgumentNullException(nameof(client)); _client.Disconnected += Client_Disconnected; _reconnectTimer = new Timer(20000); _reconnectTimer.Elapsed += ReconnectTimer_Elapsed; _reconnectTimer.Start(); }
/// <summary> /// Creates a new ClientReConnecter object. /// It is not needed to start ClientReConnecter since it automatically /// starts when the client disconnected. /// /// </summary> /// <param name="client">Reference to client object</param><exception cref="T:System.ArgumentNullException">Throws ArgumentNullException if client is null.</exception> public ClientReConnecter(IConnectableClient client) { if (client == null) throw new ArgumentNullException("client"); this._client = client; this._client.Disconnected += new EventHandler(this.Client_Disconnected); this._reconnectTimer = new Timer(20000); this._reconnectTimer.Elapsed += new EventHandler(this.ReconnectTimer_Elapsed); this._reconnectTimer.Start(); }
/// <summary> /// Creates a new ClientReConnecter object. /// It is not needed to start ClientReConnecter since it automatically /// starts when the client disconnected. /// /// </summary> /// <param name="client">Reference to client object</param><exception cref="T:System.ArgumentNullException">Throws ArgumentNullException if client is null.</exception> public ClientReConnecter(IConnectableClient client) { if (client == null) { throw new ArgumentNullException("client"); } this._client = client; this._client.Disconnected += new EventHandler(this.Client_Disconnected); this._reconnectTimer = new Timer(20000); this._reconnectTimer.Elapsed += new EventHandler(this.ReconnectTimer_Elapsed); this._reconnectTimer.Start(); }
/// <summary> /// Creates a new ClientReConnecter object. /// It is not needed to start ClientReConnecter since it automatically /// starts when the client disconnected. /// </summary> /// <param name="client">Reference to client object</param> /// <exception cref="ArgumentNullException">Throws ArgumentNullException if client is null.</exception> public ClientReConnecter(IConnectableClient client) { if (client == null) { throw new ArgumentNullException("client"); } _client = client; _client.Disconnected += Client_Disconnected; _reconnectTimer = new SimpleConnectionTimer(20000); _reconnectTimer.Elapsed += ReconnectTimer_Elapsed; _reconnectTimer.Start(); }
/// <summary> /// Creates a new ClientReConnecter object. /// It is not needed to start ClientReConnecter since it automatically /// starts when the client disconnected. /// </summary> /// <param name="client">Reference to client object</param> /// <exception cref="ArgumentNullException">Throws ArgumentNullException if client is null.</exception> public ClientReConnecter(IConnectableClient client) { if (client == null) { throw new ArgumentNullException("client"); } _client = client; _client.Disconnected += Client_Disconnected; _reconnectTimer = new Timer(20000); _reconnectTimer.Elapsed += ReconnectTimer_Elapsed; _reconnectTimer.Start(); }
/// <summary> /// Creates a new AutoConnectRemoteInvokeProxy object. /// </summary> /// <param name="clientMessenger">Messenger object that is used to send/receive messages</param> /// <param name="client">Reference to the client object that is used to connect/disconnect</param> public AutoConnectRemoteInvokeProxy(RequestReplyMessenger <TMessenger> clientMessenger, IConnectableClient client) : base(clientMessenger) { _client = client; }