由于系统缓冲区空间不足或队列已满,不能执行套接字上的操作。

gwf25sz 2010-08-25 05:15:54

异常详细信息: System.Net.Sockets.SocketException: 由于系统缓冲区空间不足或队列已满,不能执行套接字上的操作。

初步估计是这个方法出了问题。。。。(本机没问题,放到服务器就出现这个问题了)
/// <summary>
/// 邮箱验证
/// </summary>
private void CheckUser()
{
string code = Request.QueryString["key"].Trim();
string uid = Lang.Decrypt(code);

sql = "select * from Sy_Authcode where UserID='" + uid + "' and Code ='" + Request.QueryString["key"].Trim() + "'";
DataTable dt = SelectEntity.BaseAccess.GetDataTable(sql);
if (dt.Rows.Count < 1)
{
Lang.ShowMessage("验证失败!");
}
else
{

if (SelectEntity.BaseAccess.GetDataTable("select * from HY_PageSet where userid='" + uid + "'").Rows.Count < 1)
{
MemberCompetence.SetDefaultPageSet(uid);
CreatHTML.CreatePage(uid, MemberCompetence.IsJianCaiUser(uid).Trim() != "jc" ? true : false);
}
sql = "update Sy_Authcode set IsChecked = 1 where UserID='" + uid + "' and Code ='" + code + "'";
SelectEntity.BaseAccess.Update(sql);
Lang.ShowMessage("验证成功,您现在可以登陆后台进行操作了!");
}
}


这个方法要改?
还是做什么措施?
看了网上的一些回答好像不怎么适合我这个 。。。。。。。

分不够可以+
...全文
502 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
wuyq11 2010-08-25
  • 打赏
  • 举报
回复
系统中毒
数据传输就及时接收到缓冲区
清除资源
还有其他程序程序导致
gwf25sz 2010-08-25
  • 打赏
  • 举报
回复
又拷错了(急的脑子都晕了。。。。。):

/// <summary>
/// 发送信息
/// </summary>
/// <param name="mobilePhone">手机号,多个用","号隔开</param>
/// <param name="type">通道类型选择,0 是默认,2 通道2, 3 即时通道</param>
/// <param name="msg">内容</param>
private void SendMessage(string mobilePhone, string name, string password)
{
//string smsAbout = Request.Form["smsAbout"];
//string txtdtTime = Request.Form["txtdtTime"];
string type="0";
string msg = "亲爱的 " + name + " 欢迎加入阳光装饰平台,您的密码为:" + password + ",系统已经发送邮件到您的邮箱,请您及时查收验证!";
string ress = "";
SMSClient smsClient = null;
try
{
string server = WebConfigurationManager.AppSettings["HostName"];
string port = WebConfigurationManager.AppSettings["HostPort"];
string SMSUser = WebConfigurationManager.AppSettings["SMSUser"];
string SMSPassword = WebConfigurationManager.AppSettings["SMSPassword"];

smsClient = new SMSClient(server, Convert.ToInt32(port), SMSUser, SMSPassword);

bool flag = smsClient.sendSMS(mobilePhone, msg, type);
if (flag)
{
ress = "成功";
}
else
{
ress = "失败";
}
}
catch (Exception ex)
{
//wrongMsg = ex.Message;
}
Session["xml"] = smsClient.SendXML;
Session["resxml"] = smsClient.ReceiveXML;
//Lang.ShowMessage(ress);
}
gwf25sz 2010-08-25
  • 打赏
  • 举报
回复
补充:


上面说的方法拷错了:





 /// <summary>
/// 发送信息
/// </summary>
/// <param name="mobilePhone">手机号,多个用","号隔开</param>
/// <param name="type">通道类型选择,0 是默认,2 通道2, 3 即时通道</param>
/// <param name="msg">内容</param>
private void SendMessage(string mobilePhone, string name, string password)
{
//string smsAbout = Request.Form["smsAbout"];
//string txtdtTime = Request.Form["txtdtTime"];
string type="0";
string msg = "亲爱的 " + name + " 欢迎加入阳光装饰平台,您的密码为:" + password + ",系统已经发送邮件到您的邮箱,请您及时查收验证!";
string ress = "";
SMSClient smsClient = null;
try
{
string server = WebConfigurationManager.AppSettings["HostName"];
string port = WebConfigurationManager.AppSettings["HostPort"];
string SMSUser = WebConfigurationManager.AppSettings["SMSUser"];
string SMSPassword = WebConfigurationManager.AppSettings["SMSPassword"];

smsClient = new SMSClient(server, Convert.ToInt32(port), SMSUser, SMSPassword);

bool flag = smsClient.sendSMS(mobilePhone, msg, type);
if (flag)
{
ress = "成功";
}
else
{
ress = "失败";
}
}
catch (Exception ex)
{
//wrongMsg = ex.Message;
}
Session["xml"] = smsClient.SendXML;
Session["resxml"] = smsClient.ReceiveXML;
//Lang.ShowMessage(ress);
}
gwf25sz 2010-08-25
  • 打赏
  • 举报
回复
完整信息:


由于系统缓冲区空间不足或队列已满,不能执行套接字上的操作。 202.165.103.162:25
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

异常详细信息: System.Net.Sockets.SocketException: 由于系统缓冲区空间不足或队列已满,不能执行套接字上的操作。 202.165.103.162:25

源错误:

执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。

堆栈跟踪:


[SocketException (0x2747): 由于系统缓冲区空间不足或队列已满,不能执行套接字上的操作。 202.165.103.162:25]
System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +239
System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) +35
System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) +224

[WebException: 无法连接到远程服务器]
System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6, Int32 timeout) +5483819
System.Net.PooledStream.Activate(Object owningObject, Boolean async, Int32 timeout, GeneralAsyncDelegate asyncCallback) +202
System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asyncCallback) +21
System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout) +332
System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) +160
System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port) +159
System.Net.Mail.SmtpClient.GetConnection() +35
System.Net.Mail.SmtpClient.Send(MailMessage message) +1213

[SmtpException: 发送邮件失败。]
Siiit.Sun.Web.RegZhuangShi.SendMail(String to, String name) in E:\DotNet\Sun\SunDecorativeSystem\RegZhuangShi.aspx.cs:228
Siiit.Sun.Web.RegZhuangShi.btnSave_Click(Object sender, EventArgs e) in E:\DotNet\Sun\SunDecorativeSystem\RegZhuangShi.aspx.cs:171
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565




--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:2.0.50727.3615; ASP.NET 版本:2.0.50727.3614
shichao102471077 2010-08-25
  • 打赏
  • 举报
回复
fs 有情帮顶

62,046

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧