Can read() function on a connected socket return zero bytes?

前端 未结 1 1644
长情又很酷
长情又很酷 2020-12-04 18:15

I know that read() is a blocking call unless I make the socket non-blocking. So I expect read() call which requests 4K of data should return a positive value ( no of bytes r

相关标签:
1条回答
  • 2020-12-04 18:36

    When a TCP connection is closed on one side read() on the other side returns 0 byte.

    0 讨论(0)
提交回复
热议问题