I am trying to find out / adjust the size of network buffers:
import socket
sock = socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
sock.getsockopt(socket.SOL_SOCKET,socket.SO_RCVBUF)
212992
What on earth is this? ~ 0.2 MBytes ..!?
However, if I am looking for the buffer size elsewhere, i.e. on the command line:
sampsa@sampsa-xps13:~/python/sockets$ cat /proc/sys/net/ipv4/tcp_wmem
4096 16384 4194304
.. I get 4096 bytes.
Let's try to set the buffer size and then check its value:
sock.setsockopt(socket.SOL_SOCKET,socket.SO_RCVBUF,1024)
sock.getsockopt(socket.SOL_SOCKET,socket.SO_RCVBUF)
2304
What's going on?
Substituting SOL_SOCKET with SOL_UDP gives "Protocol not available"
How can I adjust the max. size of the UDP packet .. or even find it out?