How to prevent multiple simultaneous connections from the same client?

tsuna tsunanet at gmail.com
Tue Nov 23 12:34:56 EST 2010


On Tue, Nov 23, 2010 at 6:45 AM, Ersin ER <ersin.er at gmail.com> wrote:
> That's why I am asking what I can do with Netty at the connection level.

But then the only thing you can do is to allow each IP address to
connect only once to your server.  This will prevent all the users
behind firewalls or modem routers from playing if there's already
another user playing from the same network, which is going to be a
very frequent problem for your users.

I don't recommend doing that, but if you really do, it's pretty
simple, you can create a ConcurrentHashSet and whenever a client
connects, you check if its IP is already in the set.  If it is, you
deny the connection, otherwise you store the IP in the set and let it
proceed.

-- 
Benoit "tsuna" Sigoure
Software Engineer @ www.StumbleUpon.com


More information about the netty-users mailing list