WSAENOTCONN - 10057 (0x2749)
A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied.
Updated: Feb 21, 2026
Technical Background
WSAENOTCONN is an error code returned by the Windows Sockets API when a request to send or receive data fails because the socket is not connected and no address was supplied. This error typically occurs in scenarios involving datagram sockets, where explicit addressing is required for communication.
Error Details
The numeric value of this error is 10057, with its hexadecimal representation being 0x2749. The error message indicates that the operation attempted to send or receive data on a socket that was not in a connected state, and no address was provided for datagram operations.
Common Causes
- Invalid Operation Context: Attempting to send or receive data on an unconnected socket. This is common when using datagram sockets (e.g., UDP) without specifying the destination address.
- Incorrect Socket Type: Using a socket type that requires connection, such as TCP, inappropriately with operations intended for datagram sockets.
Real-World Context
This error can occur in various networking scenarios where explicit addressing is necessary. For example, when using UDP to send data without specifying the destination address or attempting to establish a connection on an already connected socket.
Is This Error Critical?
The criticality of this error depends on the application's requirements and the context in which it occurs. If the application relies on sending or receiving data over a network, encountering WSAENOTCONN can indicate a misconfiguration or misuse of sockets.
How to Diagnose
- Review Operation Context: Ensure that the socket is correctly configured for the intended operation (e.g., connected for TCP, unconnected for UDP).
- Validate Parameters: Check if all necessary parameters are provided, especially destination addresses in datagram operations.
- Confirm Object Types: Verify that the correct type of socket is being used for the intended communication protocol.
- Verify Input Data: Ensure that any required input data or configuration settings are correctly set up before attempting to send or receive data.
- Check Limits or Constraints: Confirm that no system limits or constraints have been exceeded, such as maximum number of open sockets.
How to Resolve
- Correct Parameter Usage: Ensure all necessary parameters, including destination addresses for datagram operations, are correctly set before attempting to send or receive data.
- Adjust Operation Context: If the operation context is incorrect (e.g., trying to use a connected socket in an unconnected scenario), adjust the configuration accordingly.
- Restore Data: If corrupted data is suspected, restore it from backups or other reliable sources.
- Retry Operation with Valid Inputs: Attempt the operation again with valid inputs and ensure all prerequisites are met before retrying.
Developer Notes
- Always validate socket states before attempting to send or receive data.
- Ensure that datagram operations provide explicit destination addresses.
- Use appropriate socket types for the intended communication protocol (e.g., TCP vs. UDP).
Related Errors
WSAECONNREFUSED: Connection refused by the remote host.WSAENETDOWN: The network is down.WSAEADDRNOTAVAIL: Cannot assign requested address.
FAQ
Q: What does WSAENOTCONN mean?
A: It indicates that a request to send or receive data was disallowed because the socket is not connected and no address was supplied, typically in datagram operations.
Q: How can I prevent this error?
A: Ensure all necessary parameters are provided, especially destination addresses for datagram operations, and use appropriate socket types for the intended communication protocol.
Q: Is WSAENOTCONN critical?
A: The criticality depends on the application's requirements. If the application relies on network communications, encountering this error can indicate a misconfiguration or misuse of sockets.
Summary
WSAENOTCONN is an important error code in the Windows Sockets API that indicates issues related to unconnected socket operations and missing destination addresses. Understanding its context and causes can help developers diagnose and resolve network-related issues effectively.