public MainForm() { InitializeComponent(); _cts = new CancellationTokenSource(); _communicationManager = new CommunicationManager(_cts,false); _agentWorker = new AgentWorker(_communicationManager); _communicationManager.ProcessIncomingMessage = _agentWorker.HandleMessage; _communicationManager.OnListenerStarted = () => { listenerStatusLabel.Text = "Listener started"; }; }
public MainForm() { InitializeComponent(); _cts = new CancellationTokenSource(); _communicationManager = new CommunicationManager(_cts, true); _masterWorker = new MasterWorker(); _masterWorker.OnAgentConnected = OnAgentConnected; _communicationManager.ProcessIncomingMessage = _masterWorker.HandleMessage; _communicationManager.OnListenerStarted = () => { statusLabel.Text = "Listener started"; }; }
public AgentWorker(CommunicationManager commMan) { _commMan = commMan; }