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(); }
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(); }