Skip to content

Optimize memory usage when sending data on Windows #359

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
macro
  • Loading branch information
an-tao committed Oct 11, 2024
commit b6fc6d7ecce0f692970c9998c313ee17db8d942b
4 changes: 3 additions & 1 deletion trantor/net/inner/TcpConnectionImpl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,12 @@ TcpConnectionImpl::TcpConnectionImpl(EventLoop *loop,
ioChannelPtr_->setErrorCallback([this]() { handleError(); });
socketPtr_->setKeepAlive(true);
name_ = localAddr.toIpPort() + "--" + peerAddr.toIpPort();
#ifdef _WIN32
int size = sizeof(sendBufSize_);
::getsockopt(
socketPtr_->fd(), SOL_SOCKET, SO_SNDBUF, (char *)&sendBufSize_, &size);
LOG_TRACE << "Send buffer size: " << sendBufSize_ << " bytes";
LOG_TRACE << "System sending buffer size: " << sendBufSize_ << " bytes";
#endif
if (policy != nullptr)
{
tlsProviderPtr_ =
Expand Down