private void SetSettings(SettingsProvidedEventArgs e)
 {
     try
     {
         chat = new UDPChat(e.Address, e.RPort, e.LPort, e.Name);
         MessageLog.LogUpdated += c_LogUpdated;
     }
     catch (Exception ex) { MessageLog.LogSystemMessage("Error!" + ex.Message); }
 }
    public void InitServer()
    {
        if (null != udpchat)
        {
            return;
        }

        //initAdressTextField = networkAdress;
        // udpchat.targetAddress = networkAdress;
        udpchat      = new UDPChat(true);
        udpchat.port = port;
        udpchat.Init();
        initializationComplete = true;
    }
    public void InitClient(string networkAdress)
    {
        if (null != udpchat)
        {
            return;
        }

        initAdressTextField   = networkAdress;
        udpchat               = new UDPChat(false);
        udpchat.targetAddress = networkAdress;
        udpchat.port          = port;
        udpchat.Init();
        //  udpchat.StartListening();
        initializationComplete = true;
    }