Disconnecting a client

Started by
1 comment, last by pex22 18 years, 7 months ago
Hi. I want to make sure my Network class is secured before I leave it, so I implemented a TEA encryption to it and the messages are always ordered in the same way (the server should disconnect a client that sent a message with a wrong order, which also could be a wrong password). But what happens when I have 1 server with 3 clients, where 1 of them is a cheater who tries to hack my game. Right now the server wouldn't send it an encrypted random number and ask for an encrypted serial string. But if it will and the string is false? how can i disconnect that client? or if while the server doesnt get the serial the server will send to everyone something encrypted? the cheater will get it too, doesnt he? I also hope that its not my network design problem..it simply accept any connection after listen, and has only 1 private socket handler. and it always not uses Nagle's algorithm and use non-blocking sockets. Thanks, pex.
pex.
Advertisement
You can always disconnect a client with closesocket(int).

If you send a message to each person connected, you can always check before sending unverified people encrypted data. Just store whether each user has been verified before sending them important data. If they haven't, then skip them.

I don't know exactly how you programmed it, but it should be easy to filter out who you send data to.
Oh wait, I need more than 1 SOCKET, right?
after i do:
SOCKET a,b;
a=listen();
b=accept();
i dont do a=b later? i see. MSDN did that, and it seems to be different than in Johnnie's tutorial.
Thanks!
pex.

This topic is closed to new replies.

Advertisement