DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Help with Server program

  1. #1
    Join Date
    Nov 2006

    Unhappy Help with Server program

    I am currently attending a Networking Class at a Universtity. I have been given some homework and been told to do it. I need some help because i am very new to C coding. I have gone through and programed in C and know the basics. Unfortunately i have a teacher that is not a teacher but a programmer. he just goes through the class telling stories and such and expecting that we already know what he is telling us. We have tried to tell him we don't understand and nobody has finished the homework because they don't know how. I am wondering if there is anyone on here that could at least help me through with the homework (if not on here possibly through email ) and could work me through the homework problem. I really want to be able to UNDERSTAND it i don't want to just take the easy way out and have someone write the code for me.

    My teacher wrote super quickly one day the first part the homework and i will include it below because i cannot even get that to work. Im really stuck. if you would rather talk through email my email address is I would really appreciate any help you guys could give me on understanding programming a little better. What i mostly don't understand how to do is connect this to a server. ALSO I KNOW RIGHT NOW IT DOESN"T MAKE A DIFFERENCE NOW, BUT I AM ALSO PROGRAMMING WITH MACINTOSH X-CODE. IM NEW TO THIS TOO AND WOULD LIKE SOME HELP, although the code is the same for perl/c/c++ ect. I just know there might be a few different man calls etc.

    Heres the homework problem and here the program that gave us in class. Please let me know if u can help. Thank you so much:

    Homework #1:

    Write a program which does not use the client/server model. This program will read a line from the terminal, call a function to process the line, and then write the results back to the terminal. The input line should have the format of : OPERATOR:STRING where the operators indicated operations to be performed on the string. The operators are: r to reverse the order of the string, and c to reverse the case of the letters (change uppercase to lowercase and lowercase to uppercase). The function that processes the line will return a result in the same character array followed by a new line.


    #!/usr/bin/perl (used for windows to run program)
    my $pid= fork();
    print "after the fork call the pid = $pid\n";
    if($pid ==0){
    print "I am the child\n";
    else {
    sleep 1;
    print "I am the paent and the child has the pid of $pid\n";

    (PIPE PROGRAM) (for server)

    #!/usr/bin/perl (used for windows to run program)
    my $pid = fork();
    my $input;
    print "child: I am the child\n";
    close (READHANDLE);
    while (<STDIN>){
    print"child: sending $input\n";
    $input= ~ s/Ths/That/;;
    print WRITEHANDLE $input;
    else {
    my $input;
    print "parent: I am the paent and the child has the pid of $pid\n";
    $input= <READHNDLE>;
    print "parent: read $input\n;


    according to this teacher to connect the program to the server i should only have to include the following commands of which i don't know where to put:

    Writing to and from a server:

    require "";

    unlink ("myfifo.srv");
    system('mknod', "myfifo.srv", 'p;');
    system('mknod', "myfifo.clt", 'p');
    open(WRITEHANDLE1, "> myfifo.clt:);
    open (READHANDLE1, "> myfifo.srv");
    server (READHANDLE1
    close (READHANDLE1
    print "server

    FINALLY I AM SUPOSED TO MAKE THE ABOVE HOMEWORK PROGRAM #1, CONNECT TO THE SERVER AND RUN, THEN I NEED TO MAKE IT WORK WITH PIPES, FIFO'S, UDP SOCKETS, AND TCP SOCKETS. I am giving all that he gave us on the homework information just hoping that you can HELP me to make sense of it and maybe finish this homework. I am willing to put in the time to finish the homework, i just am really stuck right now. Thanks for your help in advance.


  2. #2
    Join Date
    Nov 2003
    Portland, OR
    You posted your question to the FreeVBCode forums. As the name suggests, these forums are for Visual Basic questions. I have moved your question to the DevX C++ forum, where you are more likely to receive a reply. Thanks!
    Phil Weber

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  3. #3
    Join Date
    Dec 2003
    Not C++ code either. Looks like a unix script of some sort.

Similar Threads

  1. Replies: 0
    Last Post: 05-21-2003, 01:09 PM
  2. Replies: 0
    Last Post: 05-11-2002, 02:57 AM
  3. C program
    By Matty in forum Open Source
    Replies: 0
    Last Post: 12-16-2001, 12:17 PM
  4. Program accessing both SQL Server and MS Access
    By saiful in forum VB Classic
    Replies: 0
    Last Post: 11-23-2000, 03:00 AM
  5. Remove exchange from a site
    By andriano in forum Enterprise
    Replies: 1
    Last Post: 10-02-2000, 03:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center