优化性能

This commit is contained in:
771730766@qq.com
2018-01-30 11:23:57 +08:00
parent 28b8e8e09f
commit 8c50aa6c66
10 changed files with 46 additions and 26 deletions

View File

@@ -654,6 +654,7 @@ bool RtspSession::handleReq_Play() {
if(m_pRtpReader){
weak_ptr<RtspSession> weakSelf = dynamic_pointer_cast<RtspSession>(shared_from_this());
SockUtil::setNoDelay(m_pSender->rawFD(), false);
m_pRtpReader->setReadCB([weakSelf](const RtpPacket::Ptr &pack) {
auto strongSelf = weakSelf.lock();
if(!strongSelf) {

View File

@@ -92,7 +92,7 @@ private:
return m_pSender->send(pcBuf, iSize);
}
int send(const Socket::Buffer::Ptr &pkt){
return m_pSender->send(pkt);
return m_pSender->send(pkt,SOCKET_DEFAULE_FLAGS | FLAG_MORE);
}
void shutdown() override;
bool handleReq_Options(); //处理options方法