sendto : Resource temporarily unavailable (errno 11)

后端 未结 2 1800
甜味超标
甜味超标 2021-01-06 01:45

I am having a problem with sendto.

I have a receiver who receives UPD packets with recvfrom and then replies to the sender using sendto.

Unfortunately, I am

2条回答
  •  日久生厌
    2021-01-06 02:09

    If you have to set the socket to non-blocking, you can do it safely (and only?) using select:

    select() and pselect() allow a program to monitor multiple file descriptors, waiting until one or more of the file descriptors become "ready" for some class of I/O operation (e.g., input possible). A file descriptor is considered ready if it is possible to perform the corresponding I/O operation (e.g., read(2)) without blocking.

提交回复
热议问题