I am sending out about 200 SMS messages in my asp.net app (going through the 3rd party vendor, Clickatell). I am sending out about 10 at a time and it all goes very smoothly until I have sent about 50 messages out. Then the page ultimately times out "The operation has timed out"
At that point, I have to wait about 5 minutes and then can begin sending the messages out again but now I have sent out about 190 total and I am still getting the "Operation timed out" error and it has been over an hour. I can't seem to get my asp.net site to reset. And don't know how to avoid this bottleneck of the SMS messages going out. I feel like 200 is a relatively low number and should not be bogging down the application this much.
Here is the code I am using to send out the text messages:
Protected Sub Button24_Click(sender As Object, e As EventArgs) Handles Button24.Click
MaintainScrollPositionOnPostBack = True
For Each row As GridViewRow In GridView1.Rows
If row.RowType = DataControlRowType.DataRow Then
Dim chkRow As CheckBox = TryCast(row.Cells(0).FindControl("chkRow"), CheckBox)
If chkRow.Checked Then
Dim phone As String = row.Cells(6).Text
Dim item As String = row.Cells(2).Text
Dim URL As String = "https://platform.clickatell.com/messages/http/send?apiKey=rAJiKXHPQE2rzrEW3WBTtw==&from=13397070155&to=1" + phone
URL=URL + "&content=This is a test!"
Dim myproxy As WebProxy = New WebProxy("http://ntproxyus.lxa.perfora.net:3128", False)
Dim request As WebRequest = WebRequest.Create(URL)
request.Proxy = myproxy
request.Method = "GET"
request.timeout = 5000
Dim response As HttpWebResponse = request.GetResponse()
End If
End If
Next
Me.LabeltxtConf.Visible = True
Me.LabelConf.Visible = False
For Each row2 As GridViewRow In GridView1.Rows
If row2.RowType = DataControlRowType.DataRow Then
Dim chkRow2 As CheckBox = TryCast(row2.Cells(0).FindControl("chkRow"), CheckBox)
chkRow2.Checked = False
End If
Next
End Sub