Validation of connections with winsock
On my server, I'm using WSAAccept for incomming connection. How do I validate if connection is coming from a known source? I o开发者_JAVA百科nly want to allow a specific application to connect on my server.
How can I improve this line of code?
Accept = ::WSAAccept( SOCKET_INSTANCE, NULL, NULL, NULL, 0 );
Personally I'd put a function on the client and server that does something complicated with a number input. The server sends the number to the connecting client, then the client plugs it into the function and sends it back to the server, and finally, the server checks it, if it is right it lets the client continue doing stuff, otherwise it drops the connection.
精彩评论