• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 96
  • Last Modified:

TIDTCPCMDServer disabling response

Using TCPCMDServer V10
is there a way to disable a response when client sends a command to TIDTCPCMDServer ?
0
controlr
Asked:
controlr
  • 3
  • 2
1 Solution
 
Sinisa VukCommented:
try to disable replay with:
IdCmdTCPServer1.CommandHandlers.PerformReplies := False;

Open in new window

0
 
controlrAuthor Commented:
Sinasa, thanks for the direction!

i started using  asender.PerformReply := False;  per command.  and it seems to work..

However, stating this on every execution seems useless..

is there a way to do one of these  at on formCreate:

svr.CommandHandlers[24].PerformReplies := False;    //trieds this but error

cmdDoSomething.PerformReplies := False;    //trieds this on the actual proc name but error


full points will be awarded if can implement any of the bove (preference for the command name)
0
 
Sinisa VukCommented:
You sould set PerformReplies as I noticed before - to CommandHandlers (which will then use this for all commands)
svr.CommandHandlers.PerformReplies := False;

Open in new window

0
 
controlrAuthor Commented:
that code is for overall (you gave it to me at the start) ..
When the app starts, I need to disable specific commands only (not all).
0
 
Sinisa VukCommented:
then you should assign OnCommand even of TCommand for each command ...

...
aCommand.OnCommand := CommandResponse;
...

Open in new window

....
and set PerformReply := False
procedure TForm1.CommandResponse(ASender: TIdCommand);
begin
  if ASender.Command = '.....' then
    ASender.PerformReply := False;
end;

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now