ArtHare
ArtHare

Reputation: 1836

C++: Windows Socket Error 10013

All of a sudden, my PC has stopped letting me bind to sockets. It was working last night, and when I went to test a feature after a few hours of coding, nothing would bind.

Other facts:

Here's some code that is failing:

  err = WSAStartup(wVersionRequested, &wsaData);
  if(err == 0)
  {
    aSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
    if(aSocket != INVALID_SOCKET)
    {
      SOCKADDR_IN        ReceiverAddr;
      // The IPv4 family
      ReceiverAddr.sin_family = AF_INET;
      // Port no. 63939
      ReceiverAddr.sin_port = htons(iPort);
      // From all interface (0.0.0.0)
      ReceiverAddr.sin_addr.s_addr = htonl(INADDR_ANY);
      err = bind(aSocket, (SOCKADDR*)&ReceiverAddr, sizeof(ReceiverAddr));
      if(err == 0)
      {

I have tried:

If I run netstat, there are no other applications using the ports I'm trying to listen on (generally TCP and UDP ports in and around the 63000 area). Doing another quick netstat check, the highest local port currently bound is 53843.

Pretty sure the only app I installed last night was Kerbal Space Program, which I can't imagine has broken my net drivers.

Upvotes: 5

Views: 9023

Answers (1)

ArtHare
ArtHare

Reputation: 1836

Answer edit: My new theory is NetBalancer, as I just uninstalled it, would have installed it around the time I started having trouble, and have had 2 days of 10013-free development since then. Since I assume it ties its hooks fairly deep into the net stack, it makes sense too.

Will keep updating this if they come back...

Upvotes: 3

Related Questions