A
anita
I have a requirement where I have to wait a few seconds-poll- wait a
little more- poll etc., a few times, from a remote host a couple of
times before giving up. All this in a servlet.
Its really tempting to use Thread.sleep. I have seen several
references to "dont use Thread.sleep" in J2EE. But I am planning on
using this in a servlet. I read the servlet spec which doesnt say
anything about not using Thread.sleep.
I know I am not allowed to start my own threads, because the container
maintains them. but I cant think of why I cant use thread.sleep.
What are my options for pausing a few seconds in a servlet thread ?
this is in J2EE1.4
One option is to try to wait on a socket connection with a timeout-
seems silly to waste a socket just to gt a timer facility.
Thanks
A
little more- poll etc., a few times, from a remote host a couple of
times before giving up. All this in a servlet.
Its really tempting to use Thread.sleep. I have seen several
references to "dont use Thread.sleep" in J2EE. But I am planning on
using this in a servlet. I read the servlet spec which doesnt say
anything about not using Thread.sleep.
I know I am not allowed to start my own threads, because the container
maintains them. but I cant think of why I cant use thread.sleep.
What are my options for pausing a few seconds in a servlet thread ?
this is in J2EE1.4
One option is to try to wait on a socket connection with a timeout-
seems silly to waste a socket just to gt a timer facility.
Thanks
A