Skip to content

How to set SO_SNFBUF and SO_SNDRCV for Datagram socket #449

Answered by agronholm
Lulu300 asked this question in Q&A
Discussion options

You must be logged in to vote

You can get the raw socket and then use setsockopt() on it:

import socket
from anyio import SocketAttribute

raw_socket = udpsocket.extra(SocketAttribute.raw_socket)
raw_socket.setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, 65536)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Lulu300
Comment options

Answer selected by Lulu300
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #448 on June 28, 2022 14:55.