protected override void OnStop() { if (svr != null) { svr.Stop(); svr = null; sniffer.Stop(); sniffer = null; } }
protected override void OnStart(string[] args) { OnStop(); Program.settings.Load(Program.settingsPath); svr = new WebServer(Program.settings.myWebPort, Program.settings.myHttpsPort); svr.Start(); sniffer = new Sniffer(Program.settings.smartHubIp, Program.settings.myNetworkInterfaceIndex); sniffer.onRequestReceived += Sniffer_onRequestReceived; sniffer.Start(); }
private void EditSettings_Load(object sender, EventArgs e) { nudPort.Value = Program.settings.myWebPort; txtSmartHubAddress.Text = Program.settings.smartHubIp; cbInterface.Items.AddRange(Sniffer.GetNetworkAdapterNames()); if (cbInterface.Items.Count > 0) { if (Program.settings.myNetworkInterfaceIndex >= cbInterface.Items.Count) { Program.settings.myNetworkInterfaceIndex = 0; } cbInterface.SelectedIndex = Program.settings.myNetworkInterfaceIndex; } cbEasyParse.Checked = Program.settings.easyParseMethod; txtServiceName.Text = Program.settings.serviceName; txtAcuriteAccessList.Text = Program.settings.accessIpsSemicolonSeparated; nudHttpsPort.Value = Program.settings.myHttpsPort; }