   WSARecvFrom causes WSAEFAULT error
  Hi!I'm programming an application using UDP and Winsock 2 (asynchronous, but non-overlapped sockets). I've got a problem receiving packets, though... the handling looks like this:case FD_READ:  DWORD numberOfBytesReceived;  sockaddr_in address;  int sockaddrSize = sizeof(sockaddr);  int fail = WSARecvFrom(socket, &readBuffer, 1, &numberOfBytesReceived, 0, (sockaddr*) &address, &sockaddrSize, NULL, NULL);where 'socket' is a socket that has been bound, 'readBuffer' is a WSABUF (and I'm using that casting from sockaddr_in to sockaddr because beej's tutorial told me to).When I send a datagram to the application, I get to the last line, which returns an error. This is defined as:WSAEFAULTThe lpBuffers, lpFlags, lpFrom, lpNumberOfBytesRecvd, lpFromlen, lpOverlapped, or lpCompletionRoutine parameter is not totally contained in a valid part of the user address space: the lpFrom buffer was too small to accommodate the peer address.how can the lpFrom parameter ('(sockaddr*) &address') be too small? I'm thankful for any insights into this problem :)Dr. Lecter   
  The line lists all possible things that could cause that error. Chances are, it's something other than the struct sockaddr_in.If you're going to pass NULL for overlapped/completion, you might as well use regular ::recvfrom() by the way, and make your code more portable.Last: the lpFlags parameter isn't documented as accepting NULL on MSDN -- try passing a pointer to a DWORD containing 0 instead.   ;  int sockaddrSize = sizeof(sockaddr);Should be:int sockaddrSize = sizeof(sockaddr_in);Although I don't know if the structures are actually different sizes...   