mohammad irani mohammad irani - 1 month ago 5
Objective-C Question

What is the Default value of SO_SNDBUFF and SO_RCVBUFF set in the OS X system?

int32_t rcvBuf = 400 * 1024;
setsockopt(socketFD, SOL_SOCKET, SO_RCVBUF, &rcvBuf, 4);f

int32_t checkRcvBuf = 0;
unsigned int checkRcvBufLen = sizeof(checkRcvBuf);
getsockopt(socketFD, SOL_SOCKET, SO_RCVBUF, &checkRcvBuf, &checkRcvBufLen);

int32_t sndBuf = 400 * 1024;
setsockopt(socketFD, SOL_SOCKET, SO_SNDBUF, &sndBuf, 4);

int32_t checkSndBuf = 0;
unsigned int checkSndBufLen = sizeof(checkSndBuf);
getsockopt(socketFD, SOL_SOCKET, SO_SNDBUF, &checkSndBuf, &checkSndBufLen);

  1. Access the root of your shell (terminal)...
  2. run the /proc/sys/net/core/wmem_default file in to your shell
  3. as you reach your file run this command sysctl -a
  4. then run the next command like sysctl -a | grep -i space
  5. then you get the default size of SNDBUF and RCVBUF of your OS.