I was writing a program that has two sockets bounded to two distinct ports. I have created an object of another program, which is in a separate file(It also has a socket initialized and bounded to a separate port). I get a runtime exception and when i tried to print the WSAGetLastError it returned err code:10093.
What i want to know is, how can i use WSAStartup() and WSACleanup(). Do i need to call WSAStartup() for each socket and call WSACleanup() thrice.
Can someone help me to overcome this problem. Thanks in advance..:-)
You should call
WSAStartup()
/WSACleanup()
on a per-program basis, i.e. once per program.