Using select() for non-blocking sockets to connect always returns 1

前端 未结 2 1897
有刺的猬
有刺的猬 2020-12-10 08:17

This question is very similar (or almost identical) to In a non blocking socket connect, select() always returns 1; however, I can\'t seem to find where my code is faltering

2条回答
  •  旧巷少年郎
    2020-12-10 08:28

    When connecting in non-blocking mode and select() indicates the connection is writeable, you are then supposed to call connect() again. Doing so will return -1 with errno == ECONNRESET or whatever it is.

提交回复
热议问题