StartSocket() 공개 메소드

Begin a connection with the TPI and start listening for responses.
public StartSocket ( ) : void
리턴 void
예제 #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();
        }
예제 #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();
        }