0X0000273F

Fix WSAEAFNOSUPPORT (0X0000273F) — address incompatible with protocol

WSAEAFNOSUPPORT means your app tried to use an address type your network stack doesn't support (like IPv6 when only IPv4 is available). This fix gets your socket calls working again.

Quick answer

Change your socket to use AF_INET instead of AF_INET6, or enable IPv6 on the target interface. If you must use IPv6, pass IPV6_V6ONLY set to 0 to allow dual-stack sockets.

What’s WSAEAFNOSUPPORT (0X0000273F)?

This error code (also known as WSAEAFNOSUPPORT, decimal 10047) shows up when a Windows socket operation tries to bind, connect, or send data to an address family the system doesn't support. Most of the time, it’s your code trying to use an IPv6 address (AF_INET6) on a machine where IPv6 is disabled or not available on that network interface.

I’ve seen this happen in two common scenarios: First, you’re writing a server and calling bind() with INADDR_ANY (which is IPv4) but the socket was created with AF_INET6. Second, you’re a user running a game or tool that hardcodes an IPv6 address on a network that only uses IPv4. Either way, the fix is straightforward once you know what’s mismatched.

How to fix it — step by step

Step 1: Check your socket creation code

Open the source file where you create the socket. Make sure the first argument to socket() matches what you’ll use in bind() or connect(). If you’re using IPv4 addresses (e.g., 127.0.0.1 or any struct sockaddr_in), your socket must use AF_INET:

// Wrong — IPv6 socket with IPv4 address
SOCKET s = socket(AF_INET6, SOCK_STREAM, IPPROTO_TCP);
sockaddr_in addr;
addr.sin_family = AF_INET;  // mismatch!
bind(s, (sockaddr*)&addr, sizeof(addr));  // WSAEAFNOSUPPORT

// Right — match the family
SOCKET s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
sockaddr_in addr;
addr.sin_family = AF_INET;
bind(s, (sockaddr*)&addr, sizeof(addr));  // works

Step 2: Enable IPv6 on the interface

If you need IPv6, make sure it’s not disabled on your network adapter. Open a command prompt as admin and run:

netsh interface ipv6 show interfaces

If the interface you’re using has “Disabled” in the Admin State column, enable it:

netsh interface ipv6 set interface "Local Area Connection" admin=enabled

(Replace your adapter name — find it with netsh interface ipv6 show interfaces.)

Step 3: Use dual-stack sockets (IPv6 + IPv4 together)

If you want one socket to handle both IPv4 and IPv6 on Windows Vista or later, set IPV6_V6ONLY to 0 before binding:

SOCKET s = socket(AF_INET6, SOCK_STREAM, IPPROTO_TCP);
int off = 0;
setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&off, sizeof(off));
// Now bind with an IPv6 address — IPv4 clients will be mapped automatically

Why this happens

The Windows socket stack is strict about family matching. If your socket says AF_INET6, you can’t hand it an AF_INET address structure — even if the address itself is compatible (like 0.0.0.0). The bind() call checks the family field in the address struct and rejects it immediately. Also, some corporate networks, VPNs, or Docker setups disable IPv6 on certain interfaces, so even a correctly created IPv6 socket will fail if no interface supports it.

Alternative fixes if the main steps don’t work

  • Disable IPv6 for the app: If you can’t change the source code (third-party app), force the app to use IPv4 by disabling IPv6 system-wide (not recommended long-term). Open ncpa.cpl, right-click your adapter, uncheck “Internet Protocol Version 6 (TCP/IPv6)”.
  • Check for VPN interference: Some VPNs block IPv6 entirely. Temporarily disconnect the VPN to see if the error goes away.
  • Use a different port: Rarely, a firewall rule might block the specific port for IPv6 but not IPv4. Try port 8080 instead of 443, for example.
  • Update Winsock catalog: Corrupted Winsock entries can cause this. Run netsh winsock reset catalog as admin, then reboot.

Prevention tip

In new code, always check the return value of getaddrinfo() and loop through all results — that way you’ll pick an IPv4 address if IPv6 isn’t supported. Wrap your socket creation in a function that detects the available address families at runtime. And for server apps, use the dual-stack approach above so you don’t have to maintain two separate listener sockets.

Related Errors in Network & Connectivity
0X0000233A DNS_ERROR_RCODE_BADTIME (0X0000233A) – DNS Signature Expired VLAN Mismatch Error: Fix It in 2 Minutes 0XC00D019B Fix NS_E_NO_MEDIA_PROTOCOL 0xC00D019B in 3 steps 0XC0231012 STATUS_NDIS_OFFLOAD_CONNECTION_REJECTED (0XC0231012) Fix

Was this solution helpful?

EP
Erropedia Team
Tech Support Editors
The Erropedia editorial team researches and documents real-world tech errors from across Windows, Linux, macOS, networking, databases, cloud platforms, and more. Every solution is reviewed for accuracy and updated as software and systems evolve.