On Fri, 9 Nov 2001 20:27, Paul Hammant wrote: > Peter, > > >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. > > The problem I see is that this statement is rife : > > final ServerSocket serverSocket = factory.createServerSocket(mPort, > 5, mBindTo);
well most blocks should be using ConnectionManager and not worrying about getting ServerSockets themselves. I would consider any app that did that as one that is probaby building application at too raw a level. The only Block that should really have access to server socket factorys is ConnecttionManager. > ServerSocket ( I need not tell you) is the java.net class for accepting > connections. It was at that level I was thinking of an interception. > Perhaps we could extend that class and have a series of subcasses for > it that do diferent things. Looking at the source for it, it seems that > there is even provision for custom Socket implementations.... lots of > possibilities. possible but far too much work and far too rigid and difficult to evolve. > I think that ServerSocketFactory is the place to intercept incoming > sockets and that ConnectionManager would be untouched..... please take > another look Peter. I disagree. Originally the "Sockets" Block (precursor to SocketManager + ConnectionManager) was designed that way and I went to lengths to separate them out. I then proceeded to deprecate and remove the sockets Block. So I have done everything in my piower to move people away from that model ;) Pushing all this sort of thing into bottom layer defeats the purpose of having a layered system and removes some of the flexabilities inherent in such a system. Each time you needed to add a new feature would require complex spiderweb coding if you were to base abstraction at ServerSocket layer. Putting this in ConnectionManager layer would be far more easier to maintain and keep consistent with user expectations. It would not be totally clean (things like rate limiting would still require wrapping of socket) but that is a hazard of us passing Sockets rather than streams + other parameters. -- Cheers, Pete ----------------------------------------------------------- "Remember, your body is a temple; however, it's also your dancehall and bowling alley" -- Dharma Montgomery ----------------------------------------------------------- -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>