Solved

HttpWebRequest - Using to submit time sensitive request.

Posted on 2002-06-26
8
411 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
  • 4
  • 2
  • 2
8 Comments
 
LVL 20

Accepted Solution

by:
Silvers5 earned 385 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
 
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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

744 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now