F
fengyuyang
Unregistered / Unconfirmed
GUEST, unregistred user!
我用TIdTCPServer来接收客户断传上来的数据,可用一段时间后就死掉了,代码如下,个人感觉是线程的问题,请大家帮我看看。
procedure TService1.TCPServerConnect(AThread: TIdPeerThread);
begin
if OraSession1.Connected=False then
OraSession1.Connected:=True;
end;
procedure TService1.TCPServerExecute(AThread: TIdPeerThread);
var
ReadStatus:string;
fs:TFileStream;
StringList:TStrings;
SQLStatement:string;
FSize:Longint;
RGShopCode,RGPWD,FACTPWD:string;
TempADOQry: TOraQuery;
begin
with AThread.Connectiondo
begin
try
TOraQuery1 := TOraQuery.Create(TOraQuery);
except
Exit;
end;
数据库处理……
end;
end;
procedure TService1.TCPServerConnect(AThread: TIdPeerThread);
begin
if OraSession1.Connected=False then
OraSession1.Connected:=True;
end;
procedure TService1.TCPServerExecute(AThread: TIdPeerThread);
var
ReadStatus:string;
fs:TFileStream;
StringList:TStrings;
SQLStatement:string;
FSize:Longint;
RGShopCode,RGPWD,FACTPWD:string;
TempADOQry: TOraQuery;
begin
with AThread.Connectiondo
begin
try
TOraQuery1 := TOraQuery.Create(TOraQuery);
except
Exit;
end;
数据库处理……
end;
end;