Is it possible to make my TCPServer.OnExecute
event behave the same way as HTTPServer.OnCommandGet
behaves :
procedure TMainForm.HttpServerCommandGet(AContext: TIdContext;
ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo);
begin
AResponseInfo.ResponseNo := 200;
AResponseInfo.ContentType := 'text/plain';
AResponseInfo.ContentText := 'Hello';
end;
I tried this :
procedure TMainForm.TCPServerExecute(AContext: TIdContext);
begin
AContext.Connection.IOHandler.WriteLn('Hello');
end;
but it sends 'Hello' to the browser infinite times until I make the server inactive.