Exemple #1
0
 void ReceiveLoop()
 {
     while (true)
     {
         try {
             Array.Clear(receivebuffer, 0, receivebuffer.Length);
             clientsocket.Receive(receivebuffer);
             OnReceivedCompletePointer?.Invoke(receivebuffer);
             Thread.Sleep(30);
         }
         catch (SocketException)
         {
             mclosed = true;
             CloseSocket();
             room?.Remove(this);
             ReceiveThread.Abort();
         }
     }
 }
 public void receivecallback(ref byte[] buffer)
 {
     OnReceivedCompletePointer.Invoke(ref buffer);
 }