Example #1
0
        private RTMPMessage ReceiveNextMessage()
        {
            RTMPMessageHeader header = new RTMPMessageHeader(this, br);

            RTMPMessageBody body = new RTMPMessageBody(this, header, br);

            RTMPMessage newmessage = new RTMPMessage(this, header, body);

            RTMPChunkStream csinfo = GetChunkStream((int)header.ChunkStreamID);

            return(csinfo.AddFragment(newmessage));
        }
Example #2
0
        /// <summary>
        /// Decode this message to the correct type
        /// </summary>
        /// <returns></returns>
        public static RTMPMessage Decode(RTMPMessage msg)
        {
            Type       type   = registered[msg.Header.MessageTypeID];
            MethodInfo method = registeredDecodeMethods[msg.Header.MessageTypeID];

            if (method != null)
            {
                return((RTMPMessage)method.Invoke(null, new object[] { msg }));
            }
            else
            {
                ConstructorInfo constructor = type.GetConstructor(constructorTypes);
                return((RTMPMessage)constructor.Invoke(new object[] { msg }));
            }
        }
Example #3
0
 private void ReaderRun()
 {
     try
     {
         while (true)
         {
             RTMPMessage msg = ReceiveNextMessage();
             if (msg != null)
             {
                 msg = RTMPMessage.Decode(msg);
                 if (MessageReceived != null)
                 {
                     MessageReceived(msg);
                 }
             }
         }
     }
     catch
     {
         //lalala i dont care bye bye
     }
 }
Example #4
0
        private RTMPMessage ReceiveNextMessage()
        {
            RTMPMessageHeader header = new RTMPMessageHeader(this, br);

            RTMPMessageBody body = new RTMPMessageBody(this, header, br);

            RTMPMessage newmessage = new RTMPMessage(this, header, body);

            RTMPChunkStream csinfo = GetChunkStream((int)header.ChunkStreamID);
            return csinfo.AddFragment(newmessage);
        }
Example #5
0
 public void SendMessage(RTMPMessage message)
 {
     //TODO: if neccesary split message in smaller chunks to accomodate chunksize
     throw new NotImplementedException();
 }
Example #6
0
 public void SendMessage(RTMPMessage message)
 {
     //TODO: if neccesary split message in smaller chunks to accomodate chunksize
     throw new NotImplementedException();
 }
Example #7
0
 protected RTMPMessage(RTMPMessage msg)
 {
     Connection = msg.Connection;
     Header = msg.Header;
     Body = msg.Body;
 }
Example #8
0
 /// <summary>
 /// Decode this message to the correct type
 /// </summary>
 /// <returns></returns>
 public static RTMPMessage Decode(RTMPMessage msg)
 {
     Type type = registered[msg.Header.MessageTypeID];
     MethodInfo method = registeredDecodeMethods[msg.Header.MessageTypeID];
     if (method != null)
     {
         return (RTMPMessage)method.Invoke(null, new object[] { msg });
     }
     else
     {
         ConstructorInfo constructor = type.GetConstructor(constructorTypes);
         return (RTMPMessage)constructor.Invoke(new object[] { msg });
     }
 }
Example #9
0
 protected RTMPMessage(RTMPMessage msg)
 {
     Connection = msg.Connection;
     Header     = msg.Header;
     Body       = msg.Body;
 }