/// <summary> /// Initialize this class /// </summary> /// <exception cref="ArgumentNullException"> /// Neinicializovana IPAddress /// </exception> /// <exception cref="ArgumentOutOfRangeException"> /// Chybny argument jedneho z timeoutov, alebo IP portu /// </exception> /// <param name="ipEndPoints">Kolekcia IpEndPointov ku ktory sa bude klient striedavo pripajat pri autoreconnecte</param> /// <param name="tcpReadTimeout">TcpClient Read Timeout</param> /// <param name="tcpWriteTimeout">TcpClient Write Timeout</param> /// <param name="nsReadTimeout">NetworkStream Read Timeout</param> /// <param name="nsWriteTimeout">NetworkStream Write Timeout</param> public TcpTransportClient(IpEndPointCollection ipEndPoints, Int32 tcpReadTimeout, Int32 tcpWriteTimeout, Int32 nsReadTimeout, Int32 nsWriteTimeout) { //osetrime vstup if (ipEndPoints == null) { throw new ArgumentNullException("ipEndPoints"); } if (ipEndPoints.Count == 0) { throw new ArgumentException("ipEndPoints.Count can not be 0 !"); } if (tcpReadTimeout < -1) { throw new ArgumentOutOfRangeException("tcpReadTimeout must be >= -1"); } if (tcpWriteTimeout < -1) { throw new ArgumentOutOfRangeException("tcpWriteTimeout must be >= -1"); } if (nsReadTimeout < -1) { throw new ArgumentOutOfRangeException("nsReadTimeout must be >= -1"); } if (nsWriteTimeout < -1) { throw new ArgumentOutOfRangeException("nsWriteTimeout must be >= -1"); } //nastavime timeoty this.m_tcpReadTimeout = tcpReadTimeout; this.m_tcpWriteTimeout = tcpWriteTimeout; this.m_nsReadTimeout = nsReadTimeout; this.m_nsWriteTimeout = nsWriteTimeout; this.m_ipEndPoints = ipEndPoints; this.m_tcpClient = null; this.m_canAutoReconnect = true; }
/// <summary> /// Initialize this class /// </summary> /// <exception cref="ArgumentNullException"> /// Neinicializovana IPAddress /// </exception> /// <exception cref="ArgumentOutOfRangeException"> /// Chybny argument jedneho z timeoutov, alebo IP portu /// </exception> /// <param name="ipEndPoints">Kolekcia IpEndPointov ku ktory sa bude klient striedavo pripajat pri autoreconnecte</param> /// <param name="tcpReadTimeout">TcpClient Read Timeout</param> /// <param name="tcpWriteTimeout">TcpClient Write Timeout</param> /// <param name="nsReadTimeout">NetworkStream Read Timeout</param> /// <param name="nsWriteTimeout">NetworkStream Write Timeout</param> public TcpProtocolClient(IpEndPointCollection ipEndPoints, Int32 tcpReadTimeout, Int32 tcpWriteTimeout, Int32 nsReadTimeout, Int32 nsWriteTimeout) : base(ipEndPoints, tcpReadTimeout, tcpWriteTimeout, nsReadTimeout, nsWriteTimeout) { }
/// <summary> /// Initialize this class /// </summary> /// <exception cref="ArgumentNullException"> /// Neinicializovana IPAddress /// </exception> /// <exception cref="ArgumentOutOfRangeException"> /// Chybny argument / rozsah IP portu /// </exception> /// <param name="ipEndPoints">Kolekcia IpEndPointov ku ktory sa bude klient striedavo pripajat pri autoreconnecte</param> public TcpTransportClient(IpEndPointCollection ipEndPoints) : this(ipEndPoints, 1000, 1000, 1000, 300) { }
/// <summary> /// Initialize this class /// </summary> /// <exception cref="ArgumentNullException"> /// Neinicializovana IPAddress /// </exception> /// <exception cref="ArgumentOutOfRangeException"> /// Chybny argument / rozsah IP portu /// </exception> /// <param name="ipEndPoints">Kolekcia IpEndPointov ku ktory sa bude klient striedavo pripajat pri autoreconnecte</param> public TcpProtocolClient(IpEndPointCollection ipEndPoints) : base(ipEndPoints) { }