public void Stop() { lock (this) { if (this.communication != null) { this.communication.Stop(); this.communication = null; } } }
public void Start(IList <string> prefixes) { lock (this) { if (this.communication != null) { throw new InvalidOperationException("this"); } this.communication = new HttpCommunication(); this.communication.Received = (sender, e) => this.OnReceived(e); this.communication.Start(prefixes); } }