Пример #1
0
 private void OnApplicationPause(bool pause)
 {
     if (Socket == null)
     {
         return;
     }
     if (pause)
     {
         Paused = true;
         Socket.CloseSocket(true);
     }
     else if (Paused)
     {
         if (!Socket.Start(BindAddrIPv4, BindAddrIPv6, Port, ManualMode))
         {
             NetDebug.WriteError("[S] Cannot restore connection \"{0}\",\"{1}\" port {2}", BindAddrIPv4, BindAddrIPv6, Port);
             Socket.CloseSocket(false);
         }
     }
 }