I am trying to implement a server with multiple commands. Most commands work so far except that I want the server to send a warning to the client when the client writes an argument to the quit command. (I.E. quit xyz) and lets the user try again rather than exiting the server. Unfortunately the server quits whether the user types quit or quit arguments.
bool done = false;
do
{
if(strcmp(cmd, "quit") == 0)
{
if(strcmp(argument, "") != 0)
strcpy(replyMsg, "504 Command not implemented for that parameter.\n");
else
{
strcpy(replyMsg,"221 Service closing control connection.\n");
done = true;
}
}
while(strcmp(cmd, "quit") != 0 && done != true);
cmdis redundant still apply.