Y
yixi_370785
Unregistered / Unconfirmed
GUEST, unregistred user!
具体的错误我没法贴图,不过大体的是报ntdll.dll内存错,我一开始以为是我的代码有问题,不过我换成INDY中的DEMO中的也是有问题,请指教!
下面是SERVER中的部分代码,我觉得可能是这里有问题:
procedure TForm_Server.idtcpsrvrConnect(AThread: TIdPeerThread);
var
NewClient : PClient;
begin
getMem(NewClient,SizeOf(TClient));
NewClient.DNS := AThread.Connection.LocalName;
NewClient.Connected := Now;
NewClient.lastAction := NewClient.Connected;
NewClient.Thread := AThread;
AThread.Data := TObject(NewClient);
try
Client.LockList.Add(NewClient);
finally
Client.UnlockList;
end;
printInfo(mmo_Show,NewClient.DNS + '已经登陆');
lst_Main.Items.Add(NewClient.DNS);
end;
这完全是参考INDY中的DEMO的写法写的!
请各位DFW指教!
下面是SERVER中的部分代码,我觉得可能是这里有问题:
procedure TForm_Server.idtcpsrvrConnect(AThread: TIdPeerThread);
var
NewClient : PClient;
begin
getMem(NewClient,SizeOf(TClient));
NewClient.DNS := AThread.Connection.LocalName;
NewClient.Connected := Now;
NewClient.lastAction := NewClient.Connected;
NewClient.Thread := AThread;
AThread.Data := TObject(NewClient);
try
Client.LockList.Add(NewClient);
finally
Client.UnlockList;
end;
printInfo(mmo_Show,NewClient.DNS + '已经登陆');
lst_Main.Items.Add(NewClient.DNS);
end;
这完全是参考INDY中的DEMO的写法写的!
请各位DFW指教!