How can client raise request continuously to server after some time quantum

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Navdip
    New Member
    • Mar 2008
    • 22

    How can client raise request continuously to server after some time quantum

    Hi...friends,
    i am using client server arch. in my java application.
    i want client will raise request to server after every 5 second to get response from server. but i'm not using threads.. is there any method to breaks the opration for 5 sec.?? .or make repeated sequence of operation which will run after every 5 second....
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by Navdip
    Hi...friends,
    ... but i'm not using threads.. is there any method to breaks the opration for 5 sec.?? .or make repeated sequence of operation which will run after every 5 second....
    If you have a main method then you are using at least one thread.

    Comment

    • Navdip
      New Member
      • Mar 2008
      • 22

      #3
      Originally posted by r035198x
      If you have a main method then you are using at least one thread.
      "not using thread" means i'm not extending thread class in my application..
      now please describe how can we run our process repeatedly say after 5 sec.

      Comment

      • r035198x
        MVP
        • Sep 2006
        • 13225

        #4
        Originally posted by Navdip
        "not using thread" means i'm not extending thread class in my application..
        now please describe how can we run our process repeatedly say after 5 sec.
        Timer/TimerTask is the normal way of doing it. Not sure if you'll like it since the timer is a thread facility.

        Comment

        • JosAH
          Recognized Expert MVP
          • Mar 2007
          • 11453

          #5
          Or you might have a look at Thread.sleep() (it doesn't start another thread).

          kind regards,

          Jos

          Comment

          • r035198x
            MVP
            • Sep 2006
            • 13225

            #6
            Originally posted by JosAH
            Or you might have a look at Thread.sleep() (it doesn't start another thread).

            kind regards,

            Jos
            Crosses fingers ...

            Comment

            Working...