All communication with the TPI is handled via this class. It has the ability to send commands over the socket, monitor for responses being received from the TPI, and will also send a poll command to the TPI periodically so the connectino will not time out.
Esempio n. 1
0
        public void StartSession(int pollInterval = 1200)
        {
            if (_tpiSocket != null)
            {
                throw new Exception("TPI connection is already established.  You must Shutdown before starting a new session.");
            }

            // Start listening to changes in the zones
            foreach (Zone z in ZoneList)
            {
                z.ZoneChanged += Z_ZoneChanged;
            }

            foreach (Partition p in PartitionList)
            {
                p.PartitionChanged += P_PartitionChanged;
            }

            // Establish the socket
            _tpiSocket = new TPISocket()
            {
                Host         = this.Host,
                Port         = this.Port,
                PollInterval = pollInterval
            };

            _tpiSocket.ResponseReceived += TpiSocket_ResponseReceived;
            _tpiSocket.StartSocket();
        }
Esempio n. 2
0
        public void StartSession(int pollInterval = 1200)
        {
            if (_tpiSocket != null)
                throw new Exception("TPI connection is already established.  You must Shutdown before starting a new session.");

            // Start listening to changes in the zones
            foreach (Zone z in ZoneList)
                z.ZoneChanged += Z_ZoneChanged;

            foreach (Partition p in PartitionList)
                p.PartitionChanged += P_PartitionChanged;

            // Establish the socket
            _tpiSocket = new TPISocket()
            {
                Host = this.Host,
                Port = this.Port,
                PollInterval = pollInterval
            };

            _tpiSocket.ResponseReceived += TpiSocket_ResponseReceived;
            _tpiSocket.StartSocket();
        }