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

@@ -179,7 +179,9 @@ GSocket::GSocket()
m_reusable = false;
m_broadcast = false;
m_dobind = true;
m_initialRecvBufferSize = -1;
m_initialSendBufferSize = -1;
assert(gs_gui_functions);
/* Per-socket GUI-specific initialization */
m_ok = gs_gui_functions->Init_Socket(this);
@@ -630,6 +632,11 @@ GSocketError GSocket::Connect(GSocketStream stream)
setsockopt(m_fd, SOL_SOCKET, SO_REUSEADDR, (const char*)&arg, sizeof(arg));
}
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)
{