/// <summary> /// Start the server /// </summary> public void startServer() { if (!serverStarted) //Start fisrt time { Receiver receiver = new Receiver(); //Event on data reveived receiver.OnReceived += new Receiver.received(r_OnReceived); receiver.StartReceiver(listenPort); /*Get IP Address*/ MyIPAddress myIPAddress = new MyIPAddress(); if (myIPAddress.GetIPAddress(listenPort)) { /*Send the broadcast with all IP of server*/ sendBroadcast(serverIPs); } serverStarted = true; } else //Send only a broadcast { sendBroadcast(serverIPs); } }
/// <summary> /// Start the server /// </summary> public void startServer() { if (!serverStarted) //Start fisrt time { Receiver receiver = new Receiver(); //Event on data reveived receiver.OnReceived += new Receiver.received(r_OnReceived); receiver.StartReceiver(listenPort); /*Get IP Address*/ MyIPAddress myIPAddress = new MyIPAddress(); if (myIPAddress.GetIPAddress(listenPort)) /*Send the broadcast with all IP of server*/ sendBroadcast(serverIPs); serverStarted = true; } else //Send only a broadcast sendBroadcast(serverIPs); }