GetMessageType() public static method

Unmarshal the incoming pchc message to get message type.
public static GetMessageType ( byte byteArr ) : PCHC_MESSAGE_TYPE
byteArr byte The payload.
return PCHC_MESSAGE_TYPE
Ejemplo n.º 1
0
 /// <summary>
 /// THe handle for the received http request event.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">THe http request event.</param>
 private void ReceiveHttpRequest(object sender, HttpRequestEventArg e)
 {
     lock (this.locker)
     {
         HttpListenerRequest request = e.ListenerContext.Request;
         this.DecomposeHttpRequest(request);
         PCHC_MESSAGE_TYPE msgType = DecodeMessage.GetMessageType(this.httpRequestPayload);
         if (msgType == PCHC_MESSAGE_TYPE.INITIAL_OFFER_MESSAGE)
         {
             lock (this.initialQueue)
             {
                 this.initialQueue.Enqueue(e.ListenerContext);
             }
         }
         else if (msgType == PCHC_MESSAGE_TYPE.SEGMENT_INFO_MESSAGE)
         {
             lock (this.segmentQueue)
             {
                 this.segmentQueue.Enqueue(e.ListenerContext);
             }
         }
     }
 }