当前位置: 首页 > 图文教程 > 网络编程 > ASP.NET > C#下Socket对象的BeginReceive方法,执行后竟然不调用AsyncCallback里的回调函数

ASP.NET
HTML服务器控件介绍:HtmlInputFile控件
HTML服务器控件介绍:HtmlInputHidden控件
HTML服务器控件介绍:HtmlInputImage控件
HTML服务器控件介绍:HtmlInputRadioButton控件
HTML服务器控件介绍:HtmlInputText控件
HTML服务器控件介绍:HtmlSelect控件
HTML服务器控件介绍:HtmlTable控件
HTML服务器控件介绍:HtmlTableCell控件
HTML服务器控件介绍:HtmlTableRow控件
HTML服务器控件介绍:HtmlTextArea控件
Web服务器控件:AdRotator控件
Web服务器控件:Button控件
Web服务器控件:Calendar控件
Web服务器控件:CheckBox控件
Web服务器控件:CheckBoxList控件
Web服务器控件:DropDownList控件
Web服务器控件:HyperLink控件
Web服务器控件:Image控件
Web服务器控件:ImageButton控件
Web服务器控件:Label控件

ASP.NET 中的 C#下Socket对象的BeginReceive方法,执行后竟然不调用AsyncCallback里的回调函数


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 172 ::
收藏到网摘: n/a


到底是怎么回事?仅仅发生在我的机器上,修改了ip配置后放到别的机器上是没有任何问题的,可以很好的回调。难道我的机器有何异常?请教高手了!
某一线程下socket对象user.sock开始执行BeginReceive语句:
user.sock.BeginReceive(user.buffer,0,User.BufferSize,0,new System.AsyncCallback(DoRecevive),user);

对应的回调函数:
public static void DoRecevive(IAsyncResult ar)
{
Console.WriteLine("Begin Receive Date, Waiting for the Call Back");
//...
}
在我的机器上BeginReceive之后不执行DoRecevive函数,在别的机器上可以很好的执行该函数并且
打出“Begin Receive Date, Waiting for the Call Back”字符串