help me, my question is very noob :(
//s is TIdTCPServer
//-----------------------------------------
procedure TForm1.sConnect(AThread: TIdPeerThread); // this is line 1
var data:string;
begin
data:=athread.Connection.readln();
if data="login@username1@password1" then
begin
if checkacc(...) then
begin
gotoACC();
exit; // line 10
end;
end;
showmessage('here is line 13'); // this line called "line 13"
athread.Connection.disconnect(); // this line called "line 14"
end;
//----------------------------------------
I want my server socket application will read data and check data when user connected, if username,password correct, line 10 will exit the procedure , if not correct,line 13 will be executed and line 14 will disconnect the current connection
:(( but when the user connected to my server appicaltion without writeln("login@user1@pass1") ,it just connected only, line 13 will never reached and the s.Threads.LockList.count will be increased by 1 until the user disconnected
someone can make a client app that can connect to my server frequently without disconnecting and in my app server , s.Threads.LockList.count will be bigger and bigger
experts, please help me, how can I detect that and disconnect a connection without data within event TIdTCPServer.OnConnect, i just want to keep the connections with data only
thank all.
Our community of experts have been thoroughly vetted for their expertise and industry experience.