Exemplo n.º 1
0
 private void HandleRtmpt()
 {
     if (this._rtmptRequest == null)
     {
         string             str5;
         BufferStreamReader reader     = new BufferStreamReader(this._readBuffer);
         string[]           strArray   = reader.ReadLine().Split(new char[] { ' ' });
         string             httpMethod = strArray[0];
         string             pattern    = strArray[1];
         int startIndex = 0;
         while ((startIndex = pattern.IndexOf("%", startIndex)) != -1)
         {
             pattern = pattern.Substring(0, startIndex) + Uri.HexUnescape(pattern, ref startIndex) + pattern.Substring(startIndex);
         }
         string    protocol = strArray[2];
         Hashtable headers  = new Hashtable();
         string    str6     = null;
         while (((str5 = reader.ReadLine()) != null) && (str5 != string.Empty))
         {
             if ((str6 != null) && char.IsWhiteSpace(str5[0]))
             {
                 Hashtable hashtable2;
                 object    obj2;
                 (hashtable2 = headers)[obj2 = str6] = hashtable2[obj2] + str5;
             }
             else
             {
                 int index = str5.IndexOf(":");
                 if (index != -1)
                 {
                     str6 = str5.Substring(0, index);
                     string str7 = str5.Substring(index + 1).Trim();
                     headers[str6] = str7;
                 }
                 else
                 {
                     break;
                 }
             }
         }
         this._rtmptRequest = new RtmptRequest(this, pattern, protocol, httpMethod, headers);
     }
     if (this._readBuffer.Remaining == this._rtmptRequest.ContentLength)
     {
         RtmptEndpoint endpoint = this.Endpoint.GetMessageBroker().GetEndpoint("__@fluorinertmpt") as RtmptEndpoint;
         if (endpoint != null)
         {
             this._readBuffer.Compact();
             this._rtmptRequest.Data = this._readBuffer;
             this._readBuffer        = ByteBuffer.Allocate(0x1000);
             this._readBuffer.Flip();
             endpoint.Service(this._rtmptRequest);
             this._rtmptRequest = null;
         }
     }
 }
        private void HandleRtmpt(RtmptRequest rtmptRequest)
        {
            IEndpoint     endpoint      = this.Endpoint.GetMessageBroker().GetEndpoint(RtmptEndpoint.FluorineRtmptEndpointId);
            RtmptEndpoint rtmptEndpoint = endpoint as RtmptEndpoint;

            if (rtmptEndpoint != null)
            {
                rtmptEndpoint.Service(rtmptRequest);
            }
        }