public MyServer(int port,MySign sign) { _port = port; mysign = sign; }
public void StartListen() { _point = new IPEndPoint(_hostIP,_port); if (_socket != null) { try { _socket.Close(); } catch { } } IPAddress multicastIpAddress = IPAddress.Parse("224.0.0.1"); _socket = new UdpClient(_port,AddressFamily.InterNetwork); _socket.EnableBroadcast = true; _socket.JoinMulticastGroup(multicastIpAddress, 50); _socket.EnableBroadcast = true; if (mysign == null) { mysign = new MySign(); mysign.sign = true; } MyProcess(); }
public MainFrm() { mysign=new MySign(); InitializeComponent(); }