Hello,

I have a Delphi 6 application that talks to an external device that acts as an 
HTTP server. I am using the ICS TWSocket components for this application. I 
open up a socket to talk to the device and handle the necessary header and body 
crafting to talk to the server. In other words, I am not using the ICS HTTP 
client component but using the lower level TWSocket component and handling the 
necessary HTTP "handshaking" myself.

The headers I craft and send to the external device have the keep-alive flag 
set to TRUE. On my system, after I send anything to the external device, the 
connection will stay open continuously and will not close until approximately 
30 seconds of inactivity occurs (30 seconds where I don't make any requests of 
the external device as an HTTP server). I don't know if the external device 
closes it or if Microsoft Windows does it. But the important point is that 
normally I can do multiple sends and the connection will stay open until I send 
nothing for about 30 seconds. This works fine and is what my code expects.

However, on some of my users systems the socket is closing after every send. I 
do have code that checks for a closed socket and attempts a reconnect to the 
external device if necessary, but does not expect to have to do a reconnect 
with each transaction.

My questions are:

Is there a system setting for sockets that might be causing this anomalous 
behavior on some users systems?

If so, are there Windows API function calls I can use to query the offending 
parameter and then set it to the expected close on 30 seconds of inactivity 
instead of with each transaction?

If so, can I, or how do I do it in a manner that will not adversely affect any 
other programs running on the users system?

Thanks,
Robert
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to