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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user