added SetInitialSocketBuffers() to allow changing the send/receive buffer sizes (patch 1829576)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50028 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2007-11-17 15:21:26 +00:00
parent 795b0f1444
commit 8c029a5b02
6 changed files with 50 additions and 2 deletions

View File

@@ -541,6 +541,8 @@ GSocket::GSocket()
m_timeout = 10*60*1000;
/* 10 minutes * 60 sec * 1000 millisec */
m_establishing = false;
m_initialRecvBufferSize = -1;
m_initialSendBufferSize = -1;
assert(gs_gui_functions);
/* Per-socket GUI-specific initialization */
@@ -1019,6 +1021,11 @@ GSocketError GSocket::Connect(GSocketStream stream)
#endif
}
if (m_initialRecvBufferSize >= 0)
setsockopt(m_fd, SOL_SOCKET, SO_RCVBUF, (const char*)&m_initialRecvBufferSize, sizeof(m_initialRecvBufferSize));
if (m_initialSendBufferSize >= 0)
setsockopt(m_fd, SOL_SOCKET, SO_SNDBUF, (const char*)&m_initialSendBufferSize, sizeof(m_initialSendBufferSize));
// If a local address has been set, then we need to bind to it before calling connect
if (m_local && m_local->m_addr)
{