问一个Indy IdTCPServer基础问题
我在BCB6中装了indy9写以下代码时发生错误:
void __fastcall TForm1::IdTCPServer1Execute(TIdPeerThread *AThread)
{
TIdTCPServerConnection * conn = AThread->Connection; //此处conn=NULL,不知何故
unsigned char buf[1024];
try{
conn->ReadBuffer(buf,1024);
}
catch(...)
{
Memo1->Lines->Add("TCP Read Error!");
return;
}
}
有简单的demo请发至 solo**xiao@yahoo.com.cn (将**去掉) 谢谢!