My problem is, that I have created an MFC DLL which handles the network side of my program.
Everything goes well except one thing...
The parent/main process can switch between server/client modes like: server,client, server and client (like WarCraft3).
When I want to run two or more "server and client" instance of the program, the first goes fine, but the others come back with error messages.
Also I have set up IPC so they can communicate. The first gets the process id, and calls WSADuplicateSocket(), and the caller calls WSASocket().
All of them return 0 as error message, so as far as I know, they works fine, but the recvfrom command returns with error message 10038 WSAENOTSOCK.
Ohh I almost forgot... The binding fails in the processes except in the first. While the first process should call bind, not the others, I think that is not the problem.
#define PIPE_SIZE sizeof(WSAPROTOCOL_INFO) WSAPROTOCOL_INFO protocolinf; . . . If the process can create the pipe . . WSADuplicateSocket(serverSocket,outBytes,&protocolinf); . . If not... . . serverSocket = WSASocket(protocolinf.iAddressFamily, protocolinf.iSocketType, protocolinf.iProtocol, &protocolinf, 0, NULL); . . .
Every help is appreciated!