TServerSocket 报错Access violation at address 004864A6 in module 'NetServer.exe'.
实在是找不到什么原因报错。
这是获得线程的代码,一般超过20个线程 不知道什么原因就报错了。
void __fastcall TfrmNetServer::ssktHCYGetThread(TObject *Sender,
TServerClientWinSocket *ClientSocket,
TServerClientThread *&SocketThread)
{
try
{
AnsiString str = ClientSocket->RemoteAddress+":"+IntToStr(ClientSocket->LocalPort);
ChechIPExists(str,tvHCY);
if(hcyNode)
tvHCY->Items->AddChild(hcyNode,str);
else
{
WrriteLog("晃车仪首节点不存在");
return;
}
tvHCY->Items->Item[0]->Text = IntToStr(tvHCY->Items->Item[0]->Text.ToInt()+1);
SrvThread *srvt = new SrvThread(true,ClientSocket);
ConnThread ct;
ct.paddr = srvt;
ct.InFor = str;
ConTrd.push_back(ct);
srvt->Resume();
SocketThread = srvt;
}
catch(...)
{
WrriteLog("软件发生异常ssktHCYGetThread");
}
}
[解决办法]
看不出来,调试一下看看
[解决办法]
你不是写日子了吗?
是哪里出错的?
[解决办法]