Hi, I’m trying to set up a UDP socket that waits until a certain stream of data has been sent and then replies to the host.
So far I have:
- Created the socket using socket()
- Set options using setsockopt() - set to blocking IO
- Bound the socket to options using bind()
All three of these returned successfully but when I try to receive from the socket using recvfrom() I get an error.
My code for recvfrom:
retval = recvfrom(sockFD, dataBuffer, BUFFER_SIZE, 0, (struct sockaddr *) &hostSockAddr, &hostSockAddrSize);
I get error 22 - /* Invalid argument */.
Anyone know what I’m doing wrong?
I’ve attached part of my code.
Thanks