Operating System - HP-UX
1753776 Members
7205 Online
108799 Solutions
New Discussion

Receiving the submit request twice

 
Atul_9
New Member

Receiving the submit request twice

Hi,

I have a small socket program which receives a request from browser and does lot of processing. If the processing takes longer, by the time I finish with the processing to display the user with the successful message, I encounter the same request again.
My success message is not displayed at the browser and the server program again starts re-processing the same request.
Have you faced such problem before, why the same request appears again and the port and what is the possible remedy?

(The socket is created on a HPUX machine and accessed by the browser with IE 5.5)
1 REPLY 1
A. Clay Stephenson
Acclaimed Contributor

Re: Receiving the submit request twice

The typical way to deal with this is to maintain a cache; the cache should contain the perinent data, a timestamp, and a "count field". Each time a request comes in, the cache is searched first, if a recent "hit" is found, increment the "count field" but do nothing else. If not found, process the request and add the request to the cache, set the timestamp, and set the "count field" to 1.

The "count field" allows you to discard the least used entries as the cache fills up.
If it ain't broke, I can fix that.