WSAEADDRINUSE 0x80072740

Error code 10048 · HRESULT 0x80072740

WINDOWS

Only one usage of each socket address is normally permitted.

Also searched as: 10048, error 10048, socket error 10048, address already in use, only one usage of each socket address is normally permitted

Windows troubleshooting diagram: Device Manager warning and a system file scan
Windows errors: check drivers, system files and Event Viewer, in that order.

What it means

Winsock error 10048 "Address already in use" appears when a program tries to listen on a port that another process already uses. Developers see it when starting web servers, databases or game servers, often after a previous instance did not exit. Only one process at a time can normally bind a given IP and port.

Applies to: Windows 10, Windows 11

How to fix WSAEADDRINUSE

  1. Find the process using the port: netstat -ano | findstr :PORT, then look up the PID in Task Manager > Details
  2. Stop the old instance or end that PID with taskkill /PID number /F
  3. Change your application to use a different free port
  4. Check reserved ranges with netsh interface ipv4 show excludedportrange protocol=tcp; Hyper-V, WSL and Docker can reserve blocks of ports
  5. Wait a minute and retry if the previous instance just closed and the port is in TIME_WAIT
  6. Restart the computer if the port stays held by a stuck process

Why it happens

Another process (often a second copy of the same app) holds the port, the port sits in a range reserved by Windows networking features, or a socket from a crashed process is still closing.

FAQ

Why is a port in use when nothing is running?

Windows may have reserved it for Hyper-V, WSL or Docker; check excludedportrange with netsh.

Is 10048 the same as EADDRINUSE?

Yes, it is the Windows Sockets equivalent.

Related errors

Source: Microsoft WinError.h · fixes written and reviewed by the editors (see our editorial policy)

Last updated: