在讀到18bytes 同樣的去掉12bytes的頭 [cpp] bool RTMPProtocolSerializer::Deserialize(Header &header, IOBuffer &buffer, Variant &message) { switch (H_MT(header)) { case RM_HEADER_MESSAGETYPE_USRCTRL: { return DeserializeUsrCtrl(buffer, message[RM_USRCTRL]); } } } [cpp] bool RTMPProtocolSerializer::DeserializeUsrCtrl(IOBuffer &buffer, Variant &message) { ... switch ((uint16_t) message[RM_USRCTRL_TYPE]) { ... case RM_USRCTRL_TYPE_STREAM_SET_BUFFER_LENGTH: { AMF_CHECK_BOUNDARIES(buffer, 8); message[RM_USRCTRL_STREAMID] = ENTOHLP(GETIBPOINTER(buffer)); //----MARKED-LONG--- if (!buffer.Ignore(4)) { FATAL("Unable to ignore 4 bytes"); return false; } message[RM_USRCTRL_BUFFLEN] = ENTOHLP(GETIBPOINTER(buffer)); //----MARKED-LONG--- if (!buffer.Ignore(4)) { FATAL("Unable to ignore 4 bytes"); return false; } return true; } } } 在InboundMessageAvailable中進行回應 [cpp] bool BaseRTMPAppProtocolHandler::InboundMessageAvailable(BaseRTMPProtocol *pFrom, Variant &request) { ... switch ((uint8_t) VH_MT(request)) { case RM_HEADER_MESSAGETYPE_USRCTRL: { return ProcessUsrCtrl(pFrom, request); } } } [cpp] bool BaseRTMPAppProtocolHandler::ProcessUsrCtrl(BaseRTMPProtocol *pFrom, Variant &request) { switch ((uint16_t) M_USRCTRL_TYPE(request)) { case RM_USRCTRL_TYPE_PING_RESPONSE: { 這個函數說他啥都沒干= = return true; } } } 還是回復了468bytes的數據,但暫時沒清楚 6.直接發送音視頻了 7.好了,博主准備太監了,帶著一大堆朦胧的概念,准備完成一個更小的rtmpserver(寫代碼能力有限,估計這個server不會超過1K行),遇到困難,只能從crtmpserver中抽取代碼了~~~~(>_<)~~~~