Can a socket be closed from another thread when a send / recv on the same socket is going on?

后端 未结 5 1111
刺人心
刺人心 2021-02-02 15:48

Can a socket be closed from another thread when a send / recv on the same socket is going on?

Suppose one thread is in blocking recv call and another thread closes the s

5条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-02 16:22

    Yes, it is ok to close the socket from another thread. Any blocked/busy threads that are using that socket will report a suitable error.

提交回复
热议问题