Winsock error 10040

WSAEMSGSIZE  -  Message too long.

Basic (Microsoft) information for 10040 a.k.a. WSAEMSGSIZE

A message sent on a datagram socket was larger than the internal message buffer or some other network limit, or the buffer used to receive a datagram was smaller than the datagram itself.

Detailed (Berkeley) information for winsock 10040, described as "Message too long."

Berkeley description: A message sent on a socket was larger than the internal message buffer or some other network limit.

WinSock description: Similar to Berkeley.

Detailed description:

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. 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.

[Home] [Full list of Winsock Error codes]
[Peer Monitor - network monitoring tool] [DanielClarke.com] [Hungarian language course]