There is a SocketServer which I need to connect, receive data and then push it back to clients (web browser).
I just need to confirm the approach. I will create a Socket connection which will keep listening for message inside a ServletContextListener. The message will be then be stored in ServletContext so that it's available to push it back to client browser.
Should I create socket connection inside ServletContextLister? Or is there any other way to listen to socket?
For pushing data back to client, I don't want to have a bi-directional communication. So should I go for SSE or Html5 WebSockets? Any java framework supporting SSE or WebSocket along with client side library?
Thanks