0X00002B08

Fix WSA_QOS_ESERVICETYPE 0x2B08 Invalid Flowspec

Winsock QoS error when a service type in the flowspec isn't recognized. Fix by correcting the service type or upgrading legacy code.

You'll typically see WSA_QOS_ESERVICETYPE (0x2B08) when a legacy Winsock application tries to set up a QoS (Quality of Service) connection, but the service type in the FLOWSPEC structure isn't one the Windows QoS provider understands. This often shows up after a Windows 10 or 11 update, when older software that used the now-deprecated QOS_STANDARD or SERVICE_BESTEFFORT flags suddenly fails with WSAGetLastError() returning 11016. The exact scenario I've seen in the field: a financial trading app written in the late 2000s, using WSAConnect with a hardcoded ServiceType value that Windows 11 22H2 no longer accepts.

Root Cause

The FLOWSPEC structure has a ServiceType field that tells Windows what kind of network traffic you're sending. Windows only accepts a small set of predefined service types, like SERVICE_BESTEFFORT (1), SERVICE_CONTROLLEDLOAD (5), and SERVICE_GUARANTEED (6). If your app passes anything else — a made-up number, a bitwise OR of valid values, or a value from an older SDK that's been deprecated — the QoS provider returns WSA_QOS_ESERVICETYPE.

Most of the time, this isn't a network problem. It's a code problem. Either the application has a bug, or it's linking against an old version of ws2_32.lib that uses different constants. Also, some third-party libraries that wrap Winsock QoS are sloppy about initializing the FLOWSPEC structure, leaving garbage in the ServiceType field.

How to Fix It

Here's a step-by-step approach that resolves 95% of cases. Start with the simplest and work your way down.

  1. Check the error code. Run your app and note the exact error. If it's 11016 (0x2B08), you're in the right place. Use a small test program to confirm that the service type is being set incorrectly. If you can't modify the app, skip to step 7.
  2. Open your source code. Find where you call WSAConnect, WSAJoinLeaf, or setsockopt with SO_QOS. Look for a FLOWSPEC or QOS structure.
  3. Verify the ServiceType value. In the FLOWSPEC, make sure ServiceType is one of these:
    SERVICE_BESTEFFORT      = 0x00000001
    SERVICE_CONTROLLEDLOAD   = 0x00000005
    SERVICE_GUARANTEED       = 0x00000006
    
    If you see anything else, change it to SERVICE_BESTEFFORT unless you genuinely need guaranteed bandwidth. Most apps don't.
  4. Initialize the entire structure. If you're not zeroing out the FLOWSPEC before setting fields, you might have random bytes in ServiceType. Do this:
    FLOWSPEC flowspec;
    memset(&flowspec, 0, sizeof(flowspec));
    flowspec.ServiceType = SERVICE_BESTEFFORT;
    flowspec.TokenRate = 0;
    flowspec.TokenBucketSize = 0;
    flowspec.PeakBandwidth = 0;
    flowspec.Latency = 0;
    flowspec.DelayVariation = 0;
    flowspec.MaxSduSize = 0;
    flowspec.MinPolicedSize = 0;
    
    If you skip memset, the ServiceType field can be anything.
  5. Rebuild with the current SDK. If your code compiles fine but still fails, you might be using an outdated winsock2.h. Include the one from Windows 10/11 SDK. Usually, changing #include <winsock.h> to #include <winsock2.h> fixes it.
  6. If it's a third-party library, wrap it. You can't change the library's internals, but you can intercept the call. Use a detour or hook to override the ServiceType to SERVICE_BESTEFFORT before the actual Winsock call. That's a bit advanced, so only do it if you're comfortable with API hooks.
  7. If you can't recompile, set a registry workaround. For legacy apps that won't be updated, you can sometimes force QoS off. In HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Psched, create a DWORD NonBestEffortLimit and set it to 0. This doesn't directly fix the error, but it disables QoS enforcement on the system, which may let the app limp along. Reboot after changing the registry.

What to Check If It Still Fails

If you've done all that and the error persists, check three things:

  • Is QoS even supported on your network adapter? Open Device Manager, find your NIC, and check the Advanced tab for "QoS Packet Scheduler" or "Flow Control." If it's disabled, enable it. Some virtual adapters (like VMware) don't support QoS at all, and the error is a red herring.
  • Are you running in a container or VM? Windows containers don't support QoS the same way. If your app runs in a Docker container, you may need to use host networking or drop QoS calls entirely.
  • Is the service type a valid constant but still failing? If you set ServiceType = SERVICE_GUARANTEED and it still fails, the issue might be that the underlying network can't guarantee bandwidth. Switch to SERVICE_BESTEFFORT and let the system handle it. Guaranteed service is rarely implemented correctly anyway.

In my experience, the memset fix solves most cases. The rest are old apps that need a compatibility shim. Don't let this error make you think your network is broken — it's a software issue, and you can fix it with the steps above.

Related Errors in Server & Cloud
0X00000789 Fix RPC_S_GRP_ELT_NOT_REMOVED (0X00000789) Error AccessDeniedException AWS Lambda Permission Denied: 3 Common Causes & Fixes 0XC00002A4 Fix Active Directory error 0XC00002A4: attribute already exists 0X0DEAD107 0X0DEAD107 Fix: NTLM Quota Exceeded on Windows Server

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.