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

python - Writing Greek in matplotlib labels, titles -

c# - LINQ to Entities does not recognize the method 'Int32 IndexOf(System.String, System.StringComparison)' method -

Pygame memory leak with transform.flip -