I'm using a WebClient object and the method DownloadString to get some information from a site. The issue I am having is the server this program runs on only keeps port 80 open for a short while after the iniital connection is made. This means, if the site takes a short amount of time to get the data and send it back it works correctly. If however it takes a few minutes to get the data and send it back it will fail.
Is it possible to keep the connection open?
Or alternatively, is is possible to use a different port for WebClient?
Thanks
Using WC As New WebClient
If httpAuthentication Then
WC.Credentials = New NetworkCredential(Me.httpUsername, Me.httpPassword)
End If
Dim response As String = WC.DownloadString(Me.uploadUrl)
End Using