Hi Subu,
That is an interesting question. I will try to guess at what Terry was attempting to achieve.
The KKMultiServer code blocks within the server/user-interface itself. That is, once it gets to the serverSocket.accept() call, the server just waits for somebody to connect - it no longer accepts any keyboard commands, and there is no way to exit the program short of killing the server.
The NetworkStarterSockets class that Terry wrote has the potential to give a better user experience. It is possible that the user interface itself could remain responsive, while the DvdSocketServer handles the listening for new connections / spawning new threads. As an example of what might be possible the NetworkStarterSockets does not persist the configuration until after it has registered a DvdSocketServer.
I am curious why you copied all that code from Sun - did you have an additional question? From my perspective, the only really equivalent sections from your posting are:
subu ananthram wrote:
The followign code forks a thread for every socket accepted thereby supporting multiple clients to connect simultaneously
Below is source code from suns site for the same
Change the writing styles and these 2 blocks would be the same. Personally I don't like the embedding of the accept() call [which blocks] within the instantiation of the KKMultiServerThread class, and I don't like the lack of braces, but that is just stylistic differences. The 2 code blocks are functionally equivalent.
It is the section that you
didn't quote (the registering / starting of the DvdSocketServer class) that may have been more contextually relevant to your question.
Regards, Andrew