| Previous | Next |
| EINPROGRESS | ESTALE |
EMSGSIZE
EMSGSIZE is message-oriented: an operation requires a message to fit within a defined atomic or receive boundary, but the supplied buffer or outgoing datagram does not. It is not the same as a partial stream write. On a stream socket, successful send may write fewer bytes and the caller must advance the buffer; a datagram operation may reject an oversized message entirely.
Winsock reports the native status as WSAEMSGSIZE. On receive, an undersized datagram buffer can lose excess data for unreliable protocols; on send, a datagram too large for the provider cannot be sent atomically. The UCRT macro should therefore be interpreted through the original API and socket type.
Size boundaries to record
- Log socket type, transport, requested byte count, buffer capacity, message framing rule, and the maximum message size queried from the provider if available.
- For UDP or other datagram protocols, redesign framing or segment at an application protocol layer; do not assume a larger local buffer changes network MTU behavior.
- For receive paths, treat truncation as a protocol event and decide whether the message can be safely discarded, retried, or reassembled.
- Do not convert a message-size error into a connection timeout; the failure occurs before delivery semantics can be inferred.
References
Looking for a different code? Search another status or error code.
