WSAEMSGSIZE - Error 10040

Product: Version: Platform:
ALL ALL ALL

Question/Problem:  Message too long.

Answer/Solution: A message sent on a socket was larger than the internal message buffer or some other network limit.

Recv and Recvfrom: If the datagram you read is larger than the buffer you supplied, then Winsock truncates the datagram (i.e. copies what it can into your buffer) and fails the function.

Send and Sendto: you cannot send a datagram as large as you've requested. Note that the v1.1 Winsock specification does not explicitly state that this error occurs if the value you request is larger than the WSAData.iMaxUdpDg returned from WSAStartup. Since the buffering requirements for sending are less than for receiving datagrams, it's conceivable that you can send a datagram larger than you can receive.

Document #: Revision Date:
WSK-19980714-EM13 10/01/04

Return To KnowledgeBase Search Page