Pass my system(ls) command to my another client to run

This is a discussion on Pass my system(ls) command to my another client to run within the C Programming forums, part of the General Programming Boards category; i wish to know how to pass the command like system(ls),system(mkdir) etc to my client. in my server side i ...

  1. #1
    Registered User
    Join Date
    May 2002
    Posts
    6

    Exclamation Pass my system(ls) command to my another client to run

    i wish to know how to pass the command like system(ls),system(mkdir) etc to my client.

    in my server side i have the send(sd,(?),(?),0);

    what to put in the (?) area in order to pass the command mentioned to my client to run.

    I understand my client side need to have the
    recv(mysock,buf,strlen(buf),0);---is that correct?

    what is the way and any advise on this?

    case: to ask client enter an char input and server process it and send teh desired command back to the client and perform the desired task in client's side.

    thanks

  2. #2
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  3. #3
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,859
    >>recv(mysock,buf,strlen(buf),0);

    for send() this would be correct.

    In recv() using strlen(buf) and an empty buf will result in no data being read (as you have told recv() the buffer size is zero).
    char buf[128];

    buf[0]='\0';
    lstrlen(buf)=0;
    sizeof(buf)=128;

    Use sizeof(buf) in this case.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Server and Client process
    By wise_ron in forum Networking/Device Communication
    Replies: 1
    Last Post: 10-07-2006, 01:11 AM
  2. Replies: 40
    Last Post: 09-01-2006, 12:09 AM
  3. Run time error at client side query?
    By dp_76 in forum Networking/Device Communication
    Replies: 0
    Last Post: 07-01-2005, 03:02 AM
  4. Making standalone APP run in background
    By hart in forum Windows Programming
    Replies: 3
    Last Post: 02-27-2005, 10:20 AM
  5. Pass my system(ls) command to my another client to run
    By scchiw in forum Linux Programming
    Replies: 1
    Last Post: 05-29-2002, 06:15 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21