Archived

This topic is now archived and is closed to further replies.

Galileo430

Your advice on Pre-Login

Recommended Posts

On my UDP server. In order to login you need to complete a somewhat complex exchange.. I need someway to keep track of who is trying to login and what stage they are in.. Anyone have a idea? My idea was to assign each user a Number and check the IP every time I get a message.

Share this post


Link to post
Share on other sites
Personally, I would use TCP for logging in. The sockets make life a lot easier.
If you MUST use UDP, I would keep an array of structs that kept client ID, client ip, client state, and perhaps some client data in it. Whenever the server receives a message it runs through a command list:
1) Check to see if source IP is in the array
2) If not, add it, process data.
3) If so, process data.
4) If array is full, tell client that the server is too busy.
(Not that complex actually).
When the server and client have finished their exchange, you clear the client from the login array to free up the spot.
This does lend itself to problems though. Spoofed IP''s will easily cause your server to stop responding to others. Of course, you will need to add a timer routine to clear the array of stale logins.

I honestly can''t think of a method that is pretty good against spoofed IP DOS attacks though. Anyone else have a nice way in UDP?

Share this post


Link to post
Share on other sites