Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

HttpWebRequest - Using to submit time sensitive request.

Posted on 2002-06-26
8
Medium Priority
?
429 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:
Michel Sakr 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:Michel Sakr
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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 20

Expert Comment

by:Michel Sakr
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:Michel Sakr
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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
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…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

636 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