recvfrom - fromlen parameter
i have been fidgeting winsock's udp.
the function recvfrom mainly:
it has been acting strange
int recvfrom( SOCKET s, char FAR* buf, int len, int flags, struct sockaddr FAR* from, int FAR* fromlen );
when i call:
i get a WSAEFAULT error.
int fromlen = sizeof(sockaddr);
int recvfrom( s, data, sizeof(data), 0, NULL, &fromlen );
when i provide NULL instead of &fromlen i get no error.
is this normal? my question is why is it checking from when it is NULL? ( assuming that's the problem )
i would like to hear your thoughts.