WSAStartup on new thread
I am making a program which requires connecting to multiple networks on multiple threads. in my main function, I called WSAStartup() and succesfully connected to a network. I created a new thread, and in the function that new thread will execute, I called WSAStarup() again, but it seems to not have been called since a simple call to 'gethostbyname()' returns with a '10093' error. The return value of that call to WSAStartup() was '0'. meaning it started succesfully, but it does not seem so.
Any help and/or ideas?
You shouldn't have to call it again because WSAStartup initializes the Winsock DLL for the whole process. Unless you created a new process, both threads should be in the same process.
I was going to say something similar.
Although calling it again is not an error according to my [aged, 1.1] docs. You just need to remember to call WSACleanup a corresponding number of times.
I suspect the problem lies elsewhere?