From 7038924c6f56240d4e22bbd5c6a70f194f86c206 Mon Sep 17 00:00:00 2001 From: xiongguangjie Date: Fri, 3 Jun 2022 18:05:24 +0800 Subject: [PATCH] for srt set recv buf --- srt/SrtSession.cpp | 4 +++- srt/SrtSession.hpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/srt/SrtSession.cpp b/srt/SrtSession.cpp index ed7f4547..47b0b11f 100644 --- a/srt/SrtSession.cpp +++ b/srt/SrtSession.cpp @@ -47,7 +47,9 @@ EventPoller::Ptr SrtSession::queryPoller(const Buffer::Ptr &buffer) { } return nullptr; } - +void SrtSession::attachServer(const toolkit::Server &server){ + SockUtil::setRecvBuf(getSock()->rawFD(),1024 * 1024); +} void SrtSession::onRecv(const Buffer::Ptr &buffer) { uint8_t* data = (uint8_t*)buffer->data(); size_t size = buffer->size(); diff --git a/srt/SrtSession.hpp b/srt/SrtSession.hpp index 9478f1b9..401aae3c 100644 --- a/srt/SrtSession.hpp +++ b/srt/SrtSession.hpp @@ -16,7 +16,7 @@ public: void onRecv(const Buffer::Ptr &) override; void onError(const SockException &err) override; void onManager() override; - + void attachServer(const toolkit::Server &server) override; static EventPoller::Ptr queryPoller(const Buffer::Ptr &buffer); private: