c++ - Buggy call to WSACleanup() kills WSAStartup() -


I have an application that is running TCP server to start TCP I WSAStartup () run Then I have to load the third party DLL. DLL also does some TCP jobs and there is some bug in it - it runs WSAStartup () without running WSACleanup () . This bug breaks down my TCP server because DLL's WSACleanup () kills it.

I can not decide dll. How to avoid this situation use the DLL and my TCP server in various threads.

That you can see in, calculating the internal reference, WSAStartup / WSACleanup . So you only have to call WSAStartup twice.

In this way, when your library calls WSACleanup , it will reduce only one internal counting and not release all the resources.

Comments

Popular posts from this blog

asp.net - Procedure or function "Procedure name" expects a parameter "Param name" which was not supplied occurs rarely -

c# - The item with identity 'Id' already exists in the metadata collection. Parameter name: item -

c++ - Redefined variable in the other module -