Set timeout for winsock recvfrom

后端 未结 4 1594
野性不改
野性不改 2020-12-05 19:13

I\'m trying to set up a blocking socket to timeout after 16 ms of trying to recvfrom() on a port. Platform is Windows. I\'ve looked at tons of examples online and it seems

4条回答
  •  爱一瞬间的悲伤
    2020-12-05 19:38

    I'm guessing Windows from the WSASocket() call. If so you're passing the timeout incorrectly.

    MSDN says that SO_RCVTIMEO takes an int param that specifies the timeout in ms.

提交回复
热议问题