public static Communication GetInstance() { if (_instance == null) { _instance = new Communication(); } if (Client.State != CommunicationState.Opened && Client.State != CommunicationState.Opening) Client.Open(); var count = 0; while (count < 30) { count++; if (Client.State == CommunicationState.Opened) break; Thread.Sleep(500); } return _instance; }
public Communication() { _instance = this; }