Beispiel #1
0
 /// <summary>
 /// 广播
 /// </summary>
 private void BroadcastServerAlive()
 {
     byte[] localIpBytes = IPAddress.Parse(NetLib.GetLocalIpString()).GetAddressBytes();
     while (true)
     {
         if (!NetLib.BroadcastUdpData(Int32.Parse(Config.Items["BroadcastPort"]), localIpBytes))
         {
             Logger.Warning("Server Alive 广播发送失败!");
         }
         Thread.Sleep(1000);
     }
 }