Exemplo n.º 1
0
        bool IsTimeouted(TcpStream v, DateTime date)
        {
            TcpStreamMessage st = v.LastStream;

            if (st == null)
            {
                return(date < v.StartDate.Add(TimeoutSync));
            }

            return(date < st.Date.Add(Timeout));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="date">Date</param>
        /// <param name="data">Data</param>
        /// <param name="emisor">Emisor</param>
        /// <param name="previous">Previous</param>
        public TcpStreamMessage(DateTime date, byte[] data, ETcpEmisor emisor, TcpStreamMessage previous)
        {
            _Date   = date;
            _Data   = data;
            _Emisor = emisor;

            if (previous != null)
            {
                _Previous      = previous;
                previous._Next = this;
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="date">Date</param>
        /// <param name="data">Data</param>
        /// <param name="emisor">Emisor</param>
        /// <param name="previous">Previous</param>
        public TcpStreamMessage(DateTime date, byte[] data, ETcpEmisor emisor, TcpStreamMessage previous)
        {
            _Date   = date;
            _Emisor = emisor;

            _Data = data;
            //_Stream = new MemoryStream();
            //_Stream.Write(data, 0, data.Length);
            _DataLength   = data.Length;
            _DataCapacity = _DataLength;

            if (previous != null)
            {
                _Previous      = previous;
                previous._Next = this;
            }
        }