added CDiscover: searching the network for running vocaluxe server, could be useful for users who do not know what a ip address is.

This commit is contained in:
Alexander Eckart committed 2013-05-10 16:44:19 +02:00
1 parent 74af5ae691
commit b18c688936
8 files changed
+192

No files matched your search

+21
View File
@@ -19,12 +19,15 @@ namespace ClientTest
public partial class ClientTest : Form
{
CClient client;
CDiscover discover;
private bool loggedIn;
public ClientTest()
{
client = new CClient();
loggedIn = false;
discover = new CDiscover(3000, CCommands.BroadcastKeyword);
InitializeComponent();
}
@@ -32,6 +35,7 @@ namespace ClientTest
protected override void OnClosing(CancelEventArgs e)
{
client.Close();
discover.Stop();
base.OnClosing(e);
}
@@ -262,5 +266,22 @@ namespace ClientTest
client.SendMessage(CCommands.CreateCommandSendProfile(data, "TestUser", 0), OnResponse);
}
}
private void btDiscover_Click(object sender, EventArgs e)
{
tbDiscoveredServer.Text = "Searching for Vocaluxe Server:\r\n";
discover.Discover(_OnDiscovered);
}
private void _OnDiscovered(string Address, string HostName)
{
this.Invoke((MethodInvoker)delegate
{
if (Address != "Timeout")
tbDiscoveredServer.Text += "IP = " + Address + "; HostName = " + HostName + "\r\n";
else
tbDiscoveredServer.Text += "Timeout" + "\r\n";
});
}
}
}