private void StartClient() { var dlg = new EndPointDialog(); var endPoint = dlg.ShowEndPoint("link://3333"); if (endPoint != null) { var stream = CoreHelper.CreateStreamFromEndPoint(endPoint); var client = new HttpClient(stream); var form = new ClientForm(client); form.Show(); } }
private void MainForm_Load(object sender, EventArgs e) { try { var streamListener = new LinkStreamListener(3333); var server = new HttpServer(streamListener, new[] { "rho.me", }, Program.Instance.HandlerFactory); var serverForm = new HttpServerForm(server); serverForm.Show(); serverForm.ClickStartButton(); Helper.DoLater(() => { var stream = CoreHelper.CreateStreamFromEndPoint("link://3333"); var client = new HttpClient(stream); var clientForm = new ClientForm(client); clientForm.Show(); }, 100); } catch (Exception ex) { MessageBox.Show(ex.Message); } }