?
Solved

HttpWebRequest - Using to submit time sensitive request.

Posted on 2002-06-26
8
Medium Priority
?
426 Views
Last Modified: 2012-05-04
  We are trying to build an app that posts requests to a website that need to be there as close to a certain hour as possible.  The app we have built will post request but the time lags as much as 5 secs after hour.  I notices that the HttpWebRequest has methods and properties that could be helpful if we could find some descent infomation about them.  i.e. BeginGetRequestStream Method,PreAuthenticate Property,Pipelined Property,KeepAlive Property ect...  
   I believe this could be used to send a request early and by then using the EndGetRequestStream Method completing the request at the desired time. I think this would eliminate some of the problems with hitting the correct time on the host server.  Is this possible?  Do you have any code examples?  
0
Comment
Question by:ChrisGrammer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
8 Comments
 
LVL 20

Accepted Solution

by:
Silvers5 earned 1540 total points
ID: 7112801
This is not possible at all.. the IP packet routing and connection delays will render it impossible.. this is due also to the http protocole that is connectionless.. you will need to keep the data available a certain amount of time..
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 7112839
You can only get an estimation and, like Silvers5 already mentioned, the sending and retrieving can take quite some time.

Why does it have to be one hour exactly? You already have the best approach you can get. However, for the first connect you can measure the time between the opening of the connection to the closure. Then use that time to create an even better estimation of the connect time. Howrever, this is not foolproof.

CJ
0
 
LVL 20

Expert Comment

by:Silvers5
ID: 7112849
>Then use that time to create an even better estimation of the connect time

Any connection delay will render this useless.. I'm facing the same issue now where I'm fetching XML data that gets updated in the last minute before getting deleted totally remotly for a new cycle...
0
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
LVL 20

Expert Comment

by:Silvers5
ID: 7112853
A sort of workaround is to create several applications that run in parallel and log to a same or several databases .. this way you can have more chances that one will hit the closest.. and you make a routine in the backround to keep the closest records, or your presentation layer will show the closest record...
regards
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 7112887
Continueing where Silvers5 left:
You can indeed create a program on the server that stays connected with the database and does it's thing every hour. Then store the results temporarily in memory until the client needs that information (connect -> retrieve -> disconnect). You can easily simulate the users session by passing additional information in the querystring or session object.

Since the app is running on the same server you will hardly have any delay.

CJ
0
 
LVL 20

Expert Comment

by:Silvers5
ID: 7112908
I guess if he had controle over the remote server he could've done this already.. or have access to the db..
0
 

Author Comment

by:ChrisGrammer
ID: 7113340
Here is some more information about my delima.  We currently have an app that uses this approach to the problem.  I run several apps that submit the same reqeust. Each one send it's request at predetermined time. i.e. App1 starts transmitting its request at :20 sec (this is almost always extremely too early) before the hour. App2 :10 sec before ect.  Each App looks at the response received and sends another until it gets a hit on or after after the target time, or the app also stops sending if one of the other apps sets a flag letting it know that the target has been hit. Any hits before the target hour are invalid. I called it a 'sliding window approach'.  This method used to work very well, but lately a competitor has been able to hit the hour exactly with everyone else getting in as late as :5 secs later.  Additionally,  the security is changing to X509.  This is the reason for redoing this app.  On last thing, I was hoping to stretch the time out by a few seconds not an hour.  Send the a BeginGetRequestStream say :10 secs before and then Send the EndGetRequestStream 2 to 3 secs before the hour.  I might be off base but I know at least one competitor has figured out a better method. Previously, I tried a pinging approach. Thx for you interest.    
0
 

Author Comment

by:ChrisGrammer
ID: 7120386
Thx for your input.
0

Featured Post

Understanding Linux Permissions

Linux for beginners: How to view the permissions associated with files and directories and also how you can change them.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question