Note that there are some explanatory texts on larger screens.

plurals
  1. POSending SMS for a bulk of users
    primarykey
    data
    text
    <p>I want to send <code>SMS</code> to bulk of users(4000 user) so i put the following method on loop :</p> <pre><code>protected int SendSMS(string url) { // Now to Send Data. StreamWriter writer = null; StringBuilder postData = new StringBuilder(); Uri myUri = new Uri(url); postData.Append(HttpUtility.ParseQueryString(myUri.Query).Get("Username")); postData.Append(HttpUtility.ParseQueryString(myUri.Query).Get("Password")); postData.Append(HttpUtility.ParseQueryString(myUri.Query).Get("Sender")); postData.Append(HttpUtility.ParseQueryString(myUri.Query).Get("Recipients")); postData.Append(HttpUtility.ParseQueryString(myUri.Query).Get("MessageData")); string webpageContent = string.Empty; byte[] byteArray = Encoding.UTF8.GetBytes(postData.ToString()); HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url); webRequest.Method = "POST"; webRequest.ContentType = "application/x-www-form-urlencoded"; webRequest.ContentLength = webRequest.ContentLength = byteArray.Length; writer = new StreamWriter(webRequest.GetRequestStream()); try { using (Stream webpageStream = webRequest.GetRequestStream()) { webpageStream.Write(byteArray, 0, byteArray.Length); } using (HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse()) { using (StreamReader reader = new StreamReader(webResponse.GetResponseStream())) { webpageContent = reader.ReadToEnd(); //TODO:parse webpagecontent: iF response contains "OK" if (webpageContent.Contains("OK")) return 1; else return 0; } } //return 1; } catch (Exception ee) { ErrMapping.WriteLog(url); string error = ee.Message + "&lt;br&gt;&lt;br&gt;Stack Trace : " + ee.StackTrace; ErrMapping.WriteLog(error); return -1; } } </code></pre> <hr> <p>After a specific number of users like 65 user, no <code>sms</code> had been sent for the rest of users and</p> <p>I get the following exception :</p> <pre><code>Error Message:Thread was being aborted.&lt;br&gt;&lt;br&gt;Stack Trace : at System.Net.UnsafeNclNativeMethods.OSSOCK.recv(IntPtr socketHandle, Byte* pinnedBuffer, Int32 len, SocketFlags socketFlags) at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags, SocketError&amp; errorCode) at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags) at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) at System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size) at System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead) at System.Net.ConnectStream.ProcessWriteCallDone(ConnectionReturnResult returnResult) at System.Net.HttpWebRequest.CheckDeferredCallDone(ConnectStream stream) at System.Net.HttpWebRequest.GetResponse() at SendSMS_EmailUI.Frm_SMS_send.SendSMS(String url) </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload