Esempio n. 1
0
        private void connectBtn_Click(object sender, EventArgs e)
        {
            command = new EthGateway(ipTxt.Text, int.Parse(portTxt.Text), OpenSocketType.Command);
            command.DataReceived    += new EventHandler <OpenWebNetDataEventArgs>(command_DataReceived);
            command.ConnectionError += new EventHandler <OpenWebNetErrorEventArgs>(gateway_ConnectionError);

            monitor = new EthGateway(ipTxt.Text, int.Parse(portTxt.Text), OpenSocketType.Monitor);
            monitor.DataReceived    += new EventHandler <OpenWebNetDataEventArgs>(monitor_DataReceived);
            monitor.ConnectionError += new EventHandler <OpenWebNetErrorEventArgs>(monitor_ConnectionError);

            monitor.Connect();
            command.Connect();



            disconnectBtn.Enabled = true;
            connectBtn.Enabled    = false;
        }
Esempio n. 2
0
        private void start_MouseDown(object sender, MouseButtonEventArgs e)
        {
            server.Connect();

            App.logger.Debug(string.Format("Connecting...{0}:{1}", server.Host, server.Port));
        }