Why should I use, or not use, MSG_CONFIRM?

前端 未结 2 1712

I am acquainting with BSD sockets, and flicking through the man page of sendto, I bumped into MSG_CONFIRM flag, which is quite mysterious to me at

2条回答
  •  北海茫月
    2020-12-19 06:29

    You should only set the flag if the datagram you're sending is a direct response to a datagram you just received from the same peer.

    If you're sending an initial request, or sending a datagram in response to some other event (like user input, or a timeout) then you should not set the MSG_CONFIRM flag.

提交回复
热议问题