I have to write a java servlet which opens and maintain a socket client alive; this for every http session:
during first http request the servlet will open a socket communication with other server, during others requests coming from same http session the servlet will forward some infos to the socket previously opened and will receive back some data sent to the browser as response.
The goal is to maintan active a socket connection for each http session in the servlet.
To solve this i think to create an array of sockets in the global variables of the servlet, indexed depending on the session id.
could it work? any suggestions?
thanks in advance