Having an openServerSockets servlet is a bad code smell. This is primarily due to the fact that the responsibility for managing sockets is the responsibility of the container (among other resources such as workflows, sessions, etc.).
However, I donβt think you need a servlet in the first place. If you do not want to access some of the container services, it would be better if you use the J2SE application to manage ServerSockets.
source share