在每发一个字符串后加个适当的延时吧,或者来个application.doevents
解决方案 »
- 以字节数组的形式返回指定的 32 位有符号整数值。 什么意思?详细点~
- 跨窗口委托如何写?大虾们请教!
- 修改快捷方式的图标
- C#应该如何更新用户界面对象?我想实时监控剪贴板,从而控制“粘贴”菜单的启用与禁用状态。
- 集思广益,关于只能客户端系统更新方案。送分。
- 求一个程序!---为了大家将来肯定会用到的
- 如何用C++代码解释C#中的foreach循环?
- 使用CookieContainer登陆网站的问题(思归,求救)
- 安装.NET2003时提示:”安装程序无法访问WINDOWS安装程序组件“
- 求助,如何建二维Arraylist,不定长的数组?
- 100分求用asp.net和C#实现的聊天室代码(在线等)
- 请问有无关于datagrid中行改变的函数?
{
if(!m_Running){
m_Running = true; Thread tr = new Thread(new ThreadStart(this.StartProcCons));
tr.Start();
Thread trSessionCreator = new Thread(new ThreadStart(this.StartProcQueuedCons));
trSessionCreator.Start(); m_pTimer.Enabled = true;
}
}
private void StartProcCons()
{
try{
m_pListner = new Socket(AddressFamily.InterNetwork,SocketType.Stream,ProtocolType.Tcp);
m_pListner.Bind(m_pIPEndPoint);
m_pListner.Listen(500);
while(m_Running){
if(m_pSessions.Count > m_MaxConnections){
while(m_pSessions.Count > m_MaxConnections){
Thread.Sleep(100);
}
}
Socket s = m_pListner.Accept();
lock(m_pQueuedConnections){
m_pQueuedConnections.Add(s);
}
}
}
catch(SocketException x){
if(x.ErrorCode == 10004){
}
else{
OnSysError("WE MUST NEVER REACH HERE !!! StartProcCons:",x);
}
}
catch(Exception x){
OnSysError("WE MUST NEVER REACH HERE !!! StartProcCons:",x);
}
}
试试阻塞模式