发送超时时间可配置

This commit is contained in:
xiongziliang 2019-05-30 10:41:25 +08:00
parent 5304d81306
commit 0c460b397d
3 changed files with 6 additions and 6 deletions

View File

@ -102,8 +102,8 @@ get_mime_type(const char* name) {
HttpSession::HttpSession(const Socket::Ptr &pSock) : TcpSession(pSock) {
TraceP(this);
//设置15秒发送超时时间
pSock->setSendTimeOutSecond(15);
GET_CONFIG(uint32_t,keep_alive_sec,Http::kKeepAliveSecond);
pSock->setSendTimeOutSecond(keep_alive_sec);
//起始接收buffer缓存设置为4K节省内存
pSock->setReadBuffer(std::make_shared<BufferRaw>(4 * 1024));
}

View File

@ -35,8 +35,8 @@ static int kSockFlags = SOCKET_DEFAULE_FLAGS | FLAG_MORE;
RtmpSession::RtmpSession(const Socket::Ptr &pSock) : TcpSession(pSock) {
DebugP(this);
//设置15秒发送超时时间
pSock->setSendTimeOutSecond(15);
GET_CONFIG(uint32_t,keep_alive_sec,Rtmp::kKeepAliveSecond);
pSock->setSendTimeOutSecond(keep_alive_sec);
//起始接收buffer缓存设置为4K节省内存
pSock->setReadBuffer(std::make_shared<BufferRaw>(4 * 1024));
}

View File

@ -73,8 +73,8 @@ static int kSockFlags = SOCKET_DEFAULE_FLAGS | FLAG_MORE;
RtspSession::RtspSession(const Socket::Ptr &pSock) : TcpSession(pSock) {
DebugP(this);
//设置15秒发送超时时间
pSock->setSendTimeOutSecond(15);
GET_CONFIG(uint32_t,keep_alive_sec,Rtsp::kKeepAliveSecond);
pSock->setSendTimeOutSecond(keep_alive_sec);
//起始接收buffer缓存设置为4K节省内存
pSock->setReadBuffer(std::make_shared<BufferRaw>(4 * 1024));
}