Exemple #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));
        }
Exemple #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 }));
            }
        }
Exemple #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
     }
 }
Exemple #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);
        }
Exemple #5
0
 public void SendMessage(RTMPMessage message)
 {
     //TODO: if neccesary split message in smaller chunks to accomodate chunksize
     throw new NotImplementedException();
 }
Exemple #6
0
 public void SendMessage(RTMPMessage message)
 {
     //TODO: if neccesary split message in smaller chunks to accomodate chunksize
     throw new NotImplementedException();
 }
Exemple #7
0
 protected RTMPMessage(RTMPMessage msg)
 {
     Connection = msg.Connection;
     Header = msg.Header;
     Body = msg.Body;
 }
Exemple #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 });
     }
 }
Exemple #9
0
 protected RTMPMessage(RTMPMessage msg)
 {
     Connection = msg.Connection;
     Header     = msg.Header;
     Body       = msg.Body;
 }