0

Hej,

We have a weird problem with our software. We have a custom middleware that communicates through sockets. It run's succesfully on 50+ servers, clusters, both 2003 and 2008 OS. Sometimes depending on the wish of the developer that uses our middelware we deploy on their workstation (Microsoft XP) a version of our middelware.

We get the following error on a few workstations:

Either the application hasn't called WSAStartup or WSAStartup failed

I think it's about 1% of the the workstations that have this problem note: everyone has the same machine, the software on that machine can be different, other tools, development, .....

Does anybody of you has any idea how we can bugfix this? Or how we can get the reason why we get this error? We don't think it is an wrong use of sockets in our code, because our middelware component is already running 5+ years on servers (never had that problem) and other machines.

Kind regards,

Jonathan

MD XF
  • 7,062
  • 7
  • 34
  • 64
msjonathan
  • 434
  • 2
  • 10
  • 26
  • WSAStartup initialises the winsock (networking) library. The failure could be for any number of reasons, but you could try running `regsvr32` on a few of the winsock DLLs to re-register them with the system. – Polynomial Jun 08 '12 at 11:34
  • So, what does WSAStartup() return on those machines? If you don't check and don't log then fix *that* first. – Hans Passant Jun 08 '12 at 13:18
  • What do you mean by "we get following error" ? What socket API returns that error? Or is it that case that a dialog box pops up with that message? Or that you see that event in the system event logs? – selbie Jun 09 '12 at 05:22
  • Does rebooting the developer workstation make the problem go away? I suspect that the developer workstations are just "dirty" in the fact that they run other software that leaks system resources to the point where further memory or resources allocations hit a limit. While on the servers, that run in datacenters without anything else running, you never encounter this problem. Just a guess. – selbie Jun 09 '12 at 05:33
  • Hej all, Thanks for the responses, this error is shown in the Eventviewer. We are the one failing on it because the sockets are the hart of our application. Polynomial: which dll's do you mean? Hans: we get the error: a blocking operation was interrupted by a call to wsacancelblockingcall selbie: No it does not :-( but it's possible that after a reboot the error does not show up for 1 hour. But next time it shows up after 5 minutes. Kind regards, Jonathan – msjonathan Jun 19 '12 at 13:04

1 Answers1

1

For posterity: Always check what WSAStartup returns. If it's something else than 0 then handle error appropriately.

Maciej Szpakowski
  • 511
  • 1
  • 6
  • 21