I have written my server side code for long polling. I want to write the client program in java. So as per long polling, the client sends a request which is help by the server and the server responds to the request when an event occurs and then client sends a new request.
So the trouble I am facing is with the client side which is to be written in java. After I send the request, how to keep checking in the client side if the server has responded to it or not. At what intervals should I keep sending the request to the server. I am totally confused. I am quite a beginner to Web technologies. I tried googling about this but all the examples are based on client side being a java script or JSP. Could anyone give a link to a proper tutorial with client side being a java HTTp application or provide an example on this (ie to achieve long polling).