Example #1
0
 public void Disconnect()
 {
     if (rip != null)
     {
         rip.Disconnect();
         rip.Dispose();
         rip = null;
     }
 }
Example #2
0
        private async void connectButton_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.None;
            var sHost       = hostTextBox.Text;
            var sPort       = portTextBox.Text;
            var sDataServer = dataServerTextBox.Text;

            if (string.IsNullOrWhiteSpace(sHost))
            {
                hostTextBox.Focus();
                return;
            }

            if (string.IsNullOrWhiteSpace(sPort))
            {
                portTextBox.Focus();
                return;
            }

            if (string.IsNullOrWhiteSpace(sDataServer))
            {
                dataServerTextBox.Focus();
                return;
            }

            if (int.TryParse(sPort, out int port) == false || port < 0)
            {
                portTextBox.Focus();
                return;
            }

            try
            {
                RipClient = null;
                RipClient = await AppState.Instance.ConnectRipConnectionAsync(sHost, port);

                // need to connect to data server to force tlog loading on server instance
                await RipClient.ConnectOrCreateDataServerAsync(sDataServer);

                DialogResult = DialogResult.OK;
                Close();
            }
            catch (Exception x)
            {
                MessageBox.Show(x.Message, "Connect Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #3
0
 internal RipDataServer(RipClient client, string name)
 {
     this.client = client;
     this.name   = name;
 }
Example #4
0
 public void DisconnectAsync(RipClient rc)
 {
     rc.Disconnect();
     ripClients.Remove(rc);
 }