Winsock error message when you use a program that tries to bind to TCP network ports on a Windows-based computer: "WSAEADDRINUSE (10048)"

Symptoms

When you use a program that tries to bind to TCP network ports on a Windows-based computer, you may receive the following Winsock error message:
WSAEADDRINUSE (10048) Only one usage of each socket address (protocol/network address/port) is normally permitted.
This behavior occurs if the following conditions are true:
  • Internet Connection Sharing is enabled on the computer that is running Windows.
  • The program tries to connect to TCP ports in the 5001 to 5032 range.

Cause

This issue occurs because the Application Layer Gateway service reserves the TCP ports in the 5001 to 5032 range.

Status

This behavior is by design.

Workaround

To work around this behavior, stop the Application Layer Gateway service. To stop the Application Layer Gateway service, follow these steps.

Note Stop this service only if you do not have to have FTP functionality.

Note Because there are several versions of Microsoft Windows, the following steps may be different on your computer. If they are, see your product documentation to complete these steps.
  1. Click Start, type services in the Start Search box, and then press ENTER.
  2. In the results, right-click Services, and then click Run as administrator.
  3. In the Services list, right-click Application Layer Gateway Service, and then click Stop.
If you want to prevent the service starting after a restart of the computer, follow these steps:
  1. Right-click the service, and then click Properties.
  2. In the Startup type box, click Disabled, and then click OK.
  3. Exit the Services snap-in.
Properties

Article ID: 943710 - Last Review: Oct 22, 2008 - Revision: 1

Feedback