Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

uploading data - delay needed

Status
Not open for further replies.

Dashley

Programmer
Dec 5, 2002
925
US
I'm using this code below to shoot files up to a website.
Problem is if a client waits to long and sends multiple records it errors out as if its outrunning the responses.
Can anyone recommend a way to put a pause in before the request to allow the response to come back


thanks


Code:
        Try
            Dim myHttpWebRequest As HttpWebRequest = CType(WebRequest.Create(urlrequest), HttpWebRequest)

            Dim myHttpWebResponse As HttpWebResponse = CType(myHttpWebRequest.GetResponse(), HttpWebResponse)

            Dim receiveStream As Stream = myHttpWebResponse.GetResponseStream()

            Dim encode As System.Text.Encoding = System.Text.Encoding.GetEncoding("utf-8")

            Dim readStream As New StreamReader(receiveStream, encode)

            webresult = readStream.ReadToEnd()

            myHttpWebResponse.Close()
            receiveStream.Close()
            readStream.Close()

        Catch ex As Exception
            errmsg = ex.Message
            While Not ex.InnerException Is Nothing
                'send_error(errmsg,urlrequest)
                ex = ex.InnerException
            End While
        End Try

[code]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top