Ejemplo n.º 1
0
 private void buttonListen_Click(object sender, EventArgs e)
 {
     MachineLocal             = new cNetworkManager();
     MachineLocal.Role        = enRole.Server;
     MachineLocal.Port        = Convert.ToInt32(textBoxLocalPort.Text);
     MachineLocal.protocol    = Protocol.UDP;
     MachineLocal.onReceived += MachineLocal_onReceived;
     MachineLocal.Open();
     buttonListen.Enabled    = false;
     buttonNotListen.Enabled = true;
 }
Ejemplo n.º 2
0
        private void buttonConnect_Click(object sender, EventArgs e)
        {
            MachineTarget          = new cNetworkManager();
            MachineTarget.Role     = enRole.Client;
            MachineTarget.Adress   = textBoxTargetAdress.Text;
            MachineTarget.Port     = Convert.ToInt32(textBoxTargetPort.Text);
            MachineTarget.protocol = Protocol.UDP;

            MachineTarget.Open();

            buttonDisconnect.Enabled = true;
            buttonConnect.Enabled    = false;

            isTargetValid = true;
        }