本文整理汇总了C++中BaseProtocol::SignalInputData方法的典型用法代码示例。如果您正苦于以下问题:C++ BaseProtocol::SignalInputData方法的具体用法?C++ BaseProtocol::SignalInputData怎么用?C++ BaseProtocol::SignalInputData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseProtocol
的用法示例。
在下文中一共展示了BaseProtocol::SignalInputData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BindSSL
bool InboundRTMPSDiscriminatorProtocol::BindSSL(IOBuffer &buffer) {
//1. Create the RTMP protocol
BaseProtocol *pRTMP = new InboundRTMPProtocol();
if (!pRTMP->Initialize(GetCustomParameters())) {
FATAL("Unable to create RTMP protocol");
pRTMP->EnqueueForDelete();
return false;
}
//2. Destroy the link
BaseProtocol *pFar = _pFarProtocol;
pFar->ResetNearProtocol();
ResetFarProtocol();
//3. Create the new links
pFar->SetNearProtocol(pRTMP);
pRTMP->SetFarProtocol(pFar);
//4. Set the application
pRTMP->SetApplication(GetApplication());
//5. Enqueue for delete this protocol
EnqueueForDelete();
//6. Process the data
if (!pRTMP->SignalInputData(buffer)) {
FATAL("Unable to process data");
pRTMP->EnqueueForDelete();
}
return true;
}
示例2: EnqueueForOutbound
bool InboundHTTP4RTMP::ProcessSend(vector<string> &parts) {
BaseProtocol *pProtocol = Bind(parts[2]);
if (pProtocol == NULL) {
FATAL("Unable to bind protocol");
return false;
}
if (!pProtocol->SignalInputData(_inputBuffer)) {
FATAL("Unable to call upper protocol");
return false;
}
_outputBuffer.ReadFromByte(1);
IOBuffer *pBuffer = pProtocol->GetOutputBuffer();
if (pBuffer != NULL) {
_outputBuffer.ReadFromBuffer(GETIBPOINTER(*pBuffer), GETAVAILABLEBYTESCOUNT(*pBuffer));
pBuffer->IgnoreAll();
}
return BaseProtocol::EnqueueForOutbound();
}