mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-07-05 02:38:10 +08:00
发送超时时间可配置
This commit is contained in:
@@ -102,8 +102,8 @@ get_mime_type(const char* name) {
|
|||||||
|
|
||||||
HttpSession::HttpSession(const Socket::Ptr &pSock) : TcpSession(pSock) {
|
HttpSession::HttpSession(const Socket::Ptr &pSock) : TcpSession(pSock) {
|
||||||
TraceP(this);
|
TraceP(this);
|
||||||
//设置15秒发送超时时间
|
GET_CONFIG(uint32_t,keep_alive_sec,Http::kKeepAliveSecond);
|
||||||
pSock->setSendTimeOutSecond(15);
|
pSock->setSendTimeOutSecond(keep_alive_sec);
|
||||||
//起始接收buffer缓存设置为4K,节省内存
|
//起始接收buffer缓存设置为4K,节省内存
|
||||||
pSock->setReadBuffer(std::make_shared<BufferRaw>(4 * 1024));
|
pSock->setReadBuffer(std::make_shared<BufferRaw>(4 * 1024));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,8 +35,8 @@ static int kSockFlags = SOCKET_DEFAULE_FLAGS | FLAG_MORE;
|
|||||||
|
|
||||||
RtmpSession::RtmpSession(const Socket::Ptr &pSock) : TcpSession(pSock) {
|
RtmpSession::RtmpSession(const Socket::Ptr &pSock) : TcpSession(pSock) {
|
||||||
DebugP(this);
|
DebugP(this);
|
||||||
//设置15秒发送超时时间
|
GET_CONFIG(uint32_t,keep_alive_sec,Rtmp::kKeepAliveSecond);
|
||||||
pSock->setSendTimeOutSecond(15);
|
pSock->setSendTimeOutSecond(keep_alive_sec);
|
||||||
//起始接收buffer缓存设置为4K,节省内存
|
//起始接收buffer缓存设置为4K,节省内存
|
||||||
pSock->setReadBuffer(std::make_shared<BufferRaw>(4 * 1024));
|
pSock->setReadBuffer(std::make_shared<BufferRaw>(4 * 1024));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,8 +73,8 @@ static int kSockFlags = SOCKET_DEFAULE_FLAGS | FLAG_MORE;
|
|||||||
|
|
||||||
RtspSession::RtspSession(const Socket::Ptr &pSock) : TcpSession(pSock) {
|
RtspSession::RtspSession(const Socket::Ptr &pSock) : TcpSession(pSock) {
|
||||||
DebugP(this);
|
DebugP(this);
|
||||||
//设置15秒发送超时时间
|
GET_CONFIG(uint32_t,keep_alive_sec,Rtsp::kKeepAliveSecond);
|
||||||
pSock->setSendTimeOutSecond(15);
|
pSock->setSendTimeOutSecond(keep_alive_sec);
|
||||||
//起始接收buffer缓存设置为4K,节省内存
|
//起始接收buffer缓存设置为4K,节省内存
|
||||||
pSock->setReadBuffer(std::make_shared<BufferRaw>(4 * 1024));
|
pSock->setReadBuffer(std::make_shared<BufferRaw>(4 * 1024));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user