Results 1 to 7 of 7

Thread: how to wait for 5 seconds before proceeding

  1. #1

    Thread Starter
    Member saraab's Avatar
    Join Date
    Jul 2004
    Location
    Pakistan
    Posts
    32

    how to wait for 5 seconds before proceeding

    the situation is that there is an installation which calls a web service to get some information which is useful but not necessary for the applicaiton.

    Now during the installation, it is possible that the network may be down (lags, slow service etc.) or the service is not present due to some reasons.

    what i want to do here is that the installation should wait for about 5 secs after the call to the web service and then proceed regardless of the results of the function call (i.e not to wait if the service cannot be contacted for some reason )

    how can i achive that.

    THnkx

  2. #2
    Registered User NicoNel2000's Avatar
    Join Date
    Feb 2004
    Location
    Beijing - China
    Posts
    296
    Threading.Thread.Sleep(5000)

  3. #3

    Thread Starter
    Member saraab's Avatar
    Join Date
    Jul 2004
    Location
    Pakistan
    Posts
    32
    that would work when the function call has been made and the response has been recieved.

    Will it also work when the application is waiting for a response from the other side because the problem occurs when the applicaiton gets 'lost' in search of the service on the other side.


    Thankx

  4. #4
    Registered User NicoNel2000's Avatar
    Join Date
    Feb 2004
    Location
    Beijing - China
    Posts
    296
    Hi,

    Just thinking quickly, so scuse me if I talk ****e

    Maybe call the webservice in a seperate thread, and as soon the thread start, waits for 5 seconds.

    The web service can set some public variables (if successfull). Or figure out a way of calling a function returning values using a thread (so far i can call only subs)

    Anycase, after the 5 seconds, the webservice would have been running for 5 seconds, and you can see if the thread is still running (thread.isalive i think). Abort it if so (thread.abort). You then might or not have values in that public variables.

  5. #5

    Thread Starter
    Member saraab's Avatar
    Join Date
    Jul 2004
    Location
    Pakistan
    Posts
    32
    ok, will try to and tell u what happend

  6. #6
    Registered User NicoNel2000's Avatar
    Join Date
    Feb 2004
    Location
    Beijing - China
    Posts
    296
    feedback will be gr8.

    For incase you did not get there yet, it's a good idea setting aside a day or two figuring out threading in vb.net.

    Let me know if you need a tutorial and sample app. Got a nice few from the vb.net resource kit. too big to add here though

  7. #7

    Thread Starter
    Member saraab's Avatar
    Join Date
    Jul 2004
    Location
    Pakistan
    Posts
    32
    sure that will be a great help

    plz mail it to "[email protected]" if thats easy for you

    thankx

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width