mirror of
https://github.com/wolfpld/tracy
synced 2025-04-29 12:23:53 +00:00
Allow retrieval of socket send buffer size.
This commit is contained in:
parent
45750a05a1
commit
57cd6d3ed5
@ -149,6 +149,18 @@ int Socket::Send( const void* _buf, int len )
|
|||||||
return int( buf - start );
|
return int( buf - start );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int Socket::GetSendBufSize()
|
||||||
|
{
|
||||||
|
int bufSize;
|
||||||
|
int sz = sizeof( bufSize );
|
||||||
|
#if defined _WIN32 || defined __CYGWIN__
|
||||||
|
getsockopt( m_sock, SOL_SOCKET, SO_SNDBUF, (char*)&bufSize, &sz );
|
||||||
|
#else
|
||||||
|
getsockopt( m_sock, SOL_SOCKET, SO_SNDBUF, &bufSize, &sz );
|
||||||
|
#endif
|
||||||
|
return bufSize;
|
||||||
|
}
|
||||||
|
|
||||||
int Socket::RecvBuffered( void* buf, int len, int timeout )
|
int Socket::RecvBuffered( void* buf, int len, int timeout )
|
||||||
{
|
{
|
||||||
if( len <= m_bufLeft )
|
if( len <= m_bufLeft )
|
||||||
|
@ -23,6 +23,7 @@ public:
|
|||||||
void Close();
|
void Close();
|
||||||
|
|
||||||
int Send( const void* buf, int len );
|
int Send( const void* buf, int len );
|
||||||
|
int GetSendBufSize();
|
||||||
|
|
||||||
bool Read( void* buf, int len, int timeout, std::function<bool()> exitCb );
|
bool Read( void* buf, int len, int timeout, std::function<bool()> exitCb );
|
||||||
bool ReadRaw( void* buf, int len, int timeout );
|
bool ReadRaw( void* buf, int len, int timeout );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user