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