This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

udp client

hi,

I'm trying to create a simple udp client but I have a few problems.

I started from the helloworld_evmc6678l example which receives data and sends it back.

After receiving the first packet of data, the function recvncfrom() returns every  few seconds with error number 35 (EWOULDBLOCK).

I tried setting the socket to blocking with no help.

The cards send me back the data for sometimes until it fails.

Any ideas?

Is there a better example somewhere?

  • Try using recvncfrom as a blocking call as this error happens either you are using non blocking cal in case of blocking or data starvation. you can use MSG_WAITALL as a flag with recvncfrom.

     

    thanks,

    Arun.

  • I tried

    setsockopt( s, SOL_SOCKET, SO_BLOCKING, &on, sizeof( on ) );

    and also
    i = (int)recvfrom( s, (void *)pBuf,LEN, MSG_WAITALL, (PSA)&sin1, &tmp);
    both did nor work. 
    I haven't tried MSG_WAITALL with recvncfrom. You think it would work with recvncfrom ?