Questions tagged [wsacleanup]

12 questions
9
votes
3 answers

What is the cost of WSAStartup and WSACleanup?

I have a c++ win32 program that uses sockets to download some data from a server. Before using sockets on Windows, WSAStartup must be called. MSDN says: "There must be a call to WSACleanup for each successful call to WSAStartup. Only the final…
jeforum
6
votes
3 answers

WSACleanup and atExit

Is it okay to register WSACleanup through atExit function ? We have several applications that can terminate at different points in the code so we would like to avoid putting WSACleanup everywhere throughought the code. Curently we call WSAStartup /…
user119666
6
votes
0 answers

Is it necessary to call WSACleanup before program exit

I have a Windows socket program (XP and above) that calls WSAStartup. Is it necessary to call WSACleanup before the program exits? If I don't, will there be any negative consequences? In particular is: WSACleanup(); exit(0); different from merely…
Neil Mitchell
  • 9,090
  • 1
  • 27
  • 85
1
vote
2 answers

Using boost::shared_ptr with WSACleanup

I would like to use a boost::shared_ptr in order for WSACleanup() to be called when my function goes out of scope, like this: void DoSomething() { WSAStartup(...); boost::shared_ptr WSACleaner(static_cast(0),…
tsotso
  • 322
  • 1
  • 2
  • 9
1
vote
1 answer

Consequences of not calling WSACleanup

I'm in the process of designing an application that will run on a headless Windows CE 6.0 device. The idea is to make an application that will be started at startup and run until powered off. (Basically it will look like a service, but an…
Jef Patat
  • 999
  • 1
  • 10
  • 26
1
vote
3 answers

Windows socket error code 10055

I've developed an app that uses sockets over windows. It works perfectly but after some time, the internet connection begin to fail and finally I get this error (10055), which means that my app run out of buffer space. Actually I think I am only…
aluncob
  • 87
  • 2
  • 12
1
vote
2 answers

Windows socket WSACleanup C++

I am using sockets on my program. Due to I added the WSAStartup. My application runs fine (It is always up till it gets a signal to stop). After getting the signal it stops te problem that if I write the WSACleanup function at the end of my program…
Boris Raznikov
  • 2,373
  • 10
  • 34
  • 56
0
votes
2 answers

WSACleanUp causes an exception

My app can switch between Serial and Socket connections, but neither can be open at the same time. So when I try to switch between a Socket to Serial, I delete the Socket connection. The socket based object uses a private class called UsesWinsock (a…
graham.reeds
  • 16,230
  • 17
  • 74
  • 137
0
votes
0 answers

WSACleanup called from dependent library close unintentionally MySQL connection

I have a desktop application which use MySQL database. The application worked fine unless I add a new dependency which is a dll library which communicates with special hardware using socket. This new library call WSAStartup and WSACleanup to start…
Tomas Kubes
  • 23,880
  • 18
  • 111
  • 148
0
votes
0 answers

WinDbg, "A Winsock API was called before a successful WSAStartup() or after a balancing successful WSACleanup() call was made"

WinDbg is telling me that I've done the following in my program: "A Winsock API was called before a successful WSAStartup() or after a balancing successful WSACleanup() call was made" This is strange since the stack trace seems to reveal that the…
Adam
  • 8,752
  • 12
  • 54
  • 96
0
votes
1 answer

Buggy call to WSACleanup() kills WSAStartup()

I have application that is running TCP server. To initialize TCP I run WSAStartup(). Then I need to load third party dll. Dll is also does some TCP job and has some bug - it runs WSACleanup() without running WSAStartup(). This bug brakes my TCP…
vico
  • 17,051
  • 45
  • 159
  • 315
-1
votes
1 answer

sql server has gone away error because of WSACleanup

I would like to ask for help since I don't know what to do anymore. I have a simulator created in c++, where it accepts an id input from a user and checks if it is in the database (created in mysql workbench) which is only in the localhost. sqlQuery…
Jam
  • 5
  • 3