What does Windows error code 10040 (WSAEMSGSIZE) mean?

 
Previous Next
WSAEDESTADDRREQ WSAEPROTOTYPE

WSAEMSGSIZE

WSAEMSGSIZE means that a complete message does not fit in the buffer supplied to a receive call. It is especially important for datagram and other message-oriented sockets because one receive is associated with one message.

Effect on received data

For UDP, the buffer receives the initial part of the datagram and the excess data is lost. For a reliable message-oriented transport, the service provider can retain the unread part until the caller supplies a sufficiently large buffer.

How to diagnose

  • Record the socket type and the buffer length used by the failing receive.
  • Define and enforce an application-level maximum message size.
  • Do not assume that a stream socket preserves message boundaries; a stream must be framed by the protocol itself.

Microsoft: recv


Looking for a different code? Search another status or error code.