HandleReceivedDatagram









How do I use Handle Received Datagram
Below are practical examples compiled from projects for learning and reference purposes

Featured Snippets


File name: SocketUdp.cs Copy
161         public void ReceiveLoop()
162         {
163             byte[] inBuffer = new byte[this.MTU];
164             while (this.State == PhotonSocketState.Connected)
165             {
166                 try
167                 {
168                     int read = this.sock.Receive(inBuffer);
169                     this.HandleReceivedDatagram(inBuffer, read, true);
170                 }
171                 catch (Exception e)
172                 {
173                     if (this.State != PhotonSocketState.Disconnecting && this.State != PhotonSocketState.Disconnected)
174                     {
175                         if (this.ReportDebugOfLevel(DebugLevel.ERROR))
176                         {
177                             this.EnqueueDebugReturn(DebugLevel.ERROR, "Receive issue. State: " + this.State + " Exception: " + e);
178                         }
179
180                         this.HandleException(StatusCode.ExceptionOnReceive);
181                     }
182                 }
183             } //while Connected receive
184
185             // on exit of the receive-loop: disconnect socket
186             this.Disconnect();
187         }

HandleReceivedDatagram 137 lượt xem

Gõ tìm kiếm nhanh...