操作在发送短信时有超时问题 [英] The Operation Has time out problme while sending SMS

查看:85
本文介绍了操作在发送短信时有超时问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我发送短信时,它给我一个错误,如操作已经超时,我跟踪错误是在这一行 - objStream = sResponse.GetResponse.GetResponseStream()

以下是我的代码





Dim sURL As String

Dim objReader As StreamReader

Dim objStream As Stream

Dim sResponse As WebRequest





sURL =MyAPI

sResponse = WebRequest.Create(sURL)



objStream = sResponse.GetResponse.GetResponseStream( )







可以任何人帮助我有什么不对,我不明白,因为第一次没有当我第二次发送它给我错误时给我这个错误





求助我...

谢谢

while I am sending SMS it give me Error Like "The Operation has time out " and I trace that error is in this line - "objStream = sResponse.GetResponse.GetResponseStream()"
Following is my Code


Dim sURL As String
Dim objReader As StreamReader
Dim objStream As Stream
Dim sResponse As WebRequest


sURL = " MyAPI"
sResponse = WebRequest.Create(sURL)

objStream = sResponse.GetResponse.GetResponseStream()



Can Any one help what is wrong I don't understand because first time it not give me that error while I am sending second time it give me that error


Help Me Please...
Thank You

推荐答案

问题可能是网络拥塞造成的,无论是你自己还是在网络上他的目的地。



查看您使用的API是否具有可以设置的TimeOut属性。大多数TimeOut属性都将在几毫秒内完成。从TimeOut = 3000这样的低数字开始,它会给你一个3秒的TimeOut触发器。逐渐增加TimeOut,直到您的应用程序运行稳定。不要试图超过TimeOut设置,因为它会在你的应用程序中出现性能问题,除非你使用线程来让进程在后台运行。



你可以还尝试使用新建重新初始化变量。不确定这是否会有所帮助,因为此时您的超时原因尚不清楚。
The problem can be caused by congestion on the network, either yours or at the destination.

See if the API you are using has a TimeOut property that you can set. Most TimeOut properties will work in milliseconds. Start at a low number like TimeOut = 3000 which will give you a 3 sec TimeOut trigger. Gradually increase the TimeOut until you get your application to run stable. Do not try to over do the TimeOut setting as it will have performance issues in your application unless you are using Threading to have the process run in the background.

You can also try to reinitialize your variables using "New". Not sure if that will help much because the reason for your timeouts are unknown at this time.


这篇关于操作在发送短信时有超时问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆