private void portAddButton_Click(object sender, EventArgs args) { var dlg = new ListenerEditDialog(); if (dlg.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) { try { var listener = peerCast.StartListen(new System.Net.IPEndPoint(dlg.Address, dlg.Port), dlg.LocalAccepts, dlg.GlobalAccepts); portsList.Items.Add(new PortListItem(listener)); } catch (System.Net.Sockets.SocketException) { } } }
private void portAddButton_Click(object sender, EventArgs args) { var dlg = new ListenerEditDialog(); if (dlg.ShowDialog(this)==System.Windows.Forms.DialogResult.OK) { try { var listener = peerCast.StartListen(new System.Net.IPEndPoint(dlg.Address, dlg.Port), dlg.LocalAccepts, dlg.GlobalAccepts); application.SaveSettings(); portsList.Items.Add(new PortListItem(listener)); } catch (System.Net.Sockets.SocketException) { } } }