Q:

VB6 Application being blocked by firewall after several hours

I have had a report back from a client saying that they are experiencing a problem with a VB6 application I created and their cisco firewall. The application sends HTTP POST requests to our server every few seconds sending a small base64 encoded string. The application initially works fine, but after around three hours it appears to be unable to contact our server or the internet at all. When the application is outside their firewall, the application can run happily.
I don't have any more details about the firewall but here is the VB6 code for the post (Winsock1 is a Winsock control):
strHttp = "POST" & URL & " HTTP/1.1" & vbCrLf
strHttp = strHttp & "Content-Type: application/x-www-form-urlencoded; charset=UTF-8" & vbCrLf
strHttp = strHttp & "X-Method: Submit" & vbCrLf
strHttp = strHttp & "Content-Length: " & lngBodyLength & vbCrLf
strHttp = strHttp & "Accept: text/html" & vbCrLf
strHttp = strHttp & "User-Agent: MyApplication (www.ourwebsite.com)" & vbCrLf
strHttp = strHttp & "Host: " & HOST & vbCrLf

strHttp = strHttp & vbCrLf & strBody

mainForm.Winsock1.Protocol = sckTCPProtocol
mainForm.Winsock1.RemoteHost = IP_ADDRESS
mainForm.Winsock1.RemotePort = 80

blnConnectionError = False
mainForm.Winsock1.Connect
While Not blnConnected And Not blnConnectionError
    DoEvents
Wend

mainForm.Timer_Http_Timeout.Enabled = True
mainForm.Winsock1.SendData strHttp

If the application is relaunched after the problem has occurred, it will work fine for another period of about 3 hours which makes me think/hope that I can probably do something in the code to solve this.
Is there anything about the above code that would worry a firewall?
Any ideas why it only becomes an issue after 3 hours?

A:

It's a Cisco firewall so you're most likely seeing an xlate timeout (default of 3 hours) or a problem with your HTTP requests not conforming to the HTTP RFC and getting blocked by the http inspection engine of the ASA/PIX. Is your application opening a single TCP connection and using this same connection for the entire 3 hours? If so the easiest way around this is to have your application re-establish a TCP connection on a specified interval.

