PHP - error when using socket_recv

前端 未结 1 1906
离开以前
离开以前 2021-01-27 07:42

I have a socket error when running the socket_recv inside this function:

function readByteXByteSIBmsg() {
    $msg = \"\";
    $buf=\"\";
    try {
     while( $         


        
1条回答
  •  鱼传尺愫
    2021-01-27 08:18

    The error is EAGAIN (or EWOULDBLOCK, sometimes those are the same error) and means that the socket is non-blocking and that there is nothing to read at the moment. You can busy-wait while you have that error until you read something, or you use some other method to find out if there is data to read before trying to receive.

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