Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4557782
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T17:33:24+00:00 2026-05-21T17:33:24+00:00

I have a situation where I’m trying to, from a client-side piece, call off

  • 0

I have a situation where I’m trying to, from a client-side piece, call off to a server-side piece.

I need to do this synchronously. On my server-side code, though, I’m calling off to another piece of code, which I want to have a maximum of, say, 10 seconds to return a value.

If I don’t have a response within 10 seconds, I want to force my own server piece to set my result equal to 0, and return to the client.

Here’s what I have on my server-side code so far:

   Public Function GetWebResult(ByVal inputParameter As Object) As WebReturnObject Implements IWebInterface.GetWebResult
      Dim result As New WebReturnObject
      Dim webItem As WebItem = Nothing

      _timer = New Timers.Timer
      AddHandler _timer.Elapsed, AddressOf HandleTimerElapsed
      _timer.Interval = 10000 '10 Seconds'
      _timer.AutoReset = False

      _timer.Start()
      webItem = GetAWebItem(inputParameter)
      _timer.Stop()

      result = webItem
      Return result
   End Function

   Private Sub HandleTimerElapsed(ByVal sender as Object, ByVal e As System.Timers.ElapsedEventArgs) Handles _timer.Elapsed
      'result.HasTimedOut = True'
      'result.Value = 0'
      'How do I then get back into GetWebResult?'
   End Sub

I realize this code is not functional. The problem is that I’m unsure how I would go about getting back into GetWebResult to set the appropriate return values before it is sent back to the client.

I’ve already Google’d this problem, and results were scant. The best resources I was able to find were the MSDN documentation on the Timers.Timer class, but even that isn’t terribly useful given my situation.

If anyone has any links, suggestions, etc., I would very much appreciate it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T17:33:25+00:00Added an answer on May 21, 2026 at 5:33 pm

    Call the method asynchronously with a timeout (10 seconds) you’ll be back in GetWebResult irrespective of the method call completion, then you could return from there. Sample here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have situation where in c# code I am adding an onclick client event
I have a situation in which I need to extract Data Annotations information from
I have situation where I need to authenticate a client across multiple web services.
i have situation like this: class IData { virtual void get() = 0; virtual
I have situation in which I read a record from a database. And if
I have situation where I need to change the order of the columns/adding new
I have situation like this: user submits form with action='/pay' in '/pay' I have
I have situation where I need to make sure that user has completed certain
I have situation where I generate stylesheets based on information in the database. This
I have situation like this: // Object Class class Person_Object { protected $_id; public

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.