On Fri, 9 Nov 2001 03:07, Paul Hammant wrote: > ServerSocketFactory in Cornerstone allows the creation of a ServerSocket > and is in use in a number of demo and app blocks in the Avalon project. > > If ServerSocketFactory were to return a class that wrapped the > functionality of java.net.ServerSocket, then we could have multiple > implementations of this. In fact an assembler could chain them to > perform several functions : > > * Socket filtering & address blocking > * Socket redirecting > * Load Balancing > > Thoughts?
Well its a good idea but I would not do it at SocketFactory layer but instead at the ConnectionManager layer. The ConnectionManager was actually designed with these things in mind. When originally designing this I looked at xinetd a fair bit. xinetd is a unix inetd program that does this sorta thing at process level. Essentially it does all preprocessing/checks and then hands it over to another process via stdin/stdout. So if you wanted to do this I would recomend you do it at that layer. Other things to consider adding would be * rate limiting (ie max of 10k per second on socket) * connection limiting (max of 10 connections from one port at a time) * logging who conencts - perhaps via identd protocol * logging where connects from and at what rates etc ... etc Look at any of the advanced inetd implementations for more kool ideas ;) -- Cheers, Pete "Reefers and roach clips and papers and rollers Cocaine and procaine for twenty year molars Reds and peyote to work out your bugs These are a few of my favorite drugs." -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>