Reading from sockets C HTTP

前端 未结 3 1777
慢半拍i
慢半拍i 2021-01-25 08:19

I\'m wondering how I can tell if all the data has been received from a socket. It\'s a simple web proxy and right now I\'m handling the request part, so what\'s sent should term

3条回答
  •  再見小時候
    2021-01-25 08:50

    It depends if you are on a Blocking or Non-Blocking socket.

    • If you are on a non-blocking socket, it can return 0 and set errno to EAGAIN. It just means you have to wait before trying again to read
    • If you are on a blocking socket, 0 will indicate end of File

提交回复
热议问题