WINSOCK - Setting a timeout for a connection attempt on a non existing IP?

前端 未结 3 1804
梦毁少年i
梦毁少年i 2021-02-05 08:18

I am developing a RTSP Source filter in C++, and I am using WINSOCK 2.0 - blocking socket.

When I create a blocking socket, I set its SO_RCVTIMEO to 3 secs l

3条回答
  •  北荒
    北荒 (楼主)
    2021-02-05 09:06

    Actually, Berkeley sockets have not timeout for connect, so you can not set it. ICMP PING is not helpful, i don't know why, but if host not exists you spend around 1 second with PING. Try use ARP for detect is host exists.

提交回复
热议问题