client/server program

This is a discussion on client/server program within the C Programming forums, part of the General Programming Boards category; I have a UNIX client/server program I need to write for school and I am pretty clueless when it comes ...

  1. #1
    Registered User purple's Avatar
    Join Date
    Mar 2002
    Posts
    28

    client/server program

    I have a UNIX client/server program I need to write for school and I am pretty clueless when it comes to forming and sending/receiving packets.

    Our teacher gave us a hint, but not much real direction. He suggested we use the following structure, which kind of clears up how to form the packets, but I am still confused how they are transmitted from the client and how they are received by the server.

    He also gave us a simple echo server/client, but unfortunately it really does not help because it is just sending text back and forth instead of packets. If anyone has an example that sends and receives packets or knows a site with one I would greatly appreciate any help I can get. Thanks, purple
    Code:
    typedef struct packet
    {
        unsigned int opcode:3;
        unsigned int reply:5;
        unsigned int number_1:10;
        unsigned int number_2:10;
        unsigned int number_3:10;
        unsigned int number_4:10;
    }  __attribute__ ((packed)) packet;

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

  3. #3
    Registered User purple's Avatar
    Join Date
    Mar 2002
    Posts
    28
    Thanx Hammer, that site owns.

    If anyone else has any good examples or sites please let me know.

  4. #4
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    Try this place too. It's a generic, but has a few good places to read through.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help with a program, theres something in it for you
    By engstudent363 in forum C Programming
    Replies: 1
    Last Post: 02-29-2008, 12:41 PM
  2. Replies: 4
    Last Post: 02-21-2008, 09:39 AM
  3. Using variables in system()
    By Afro in forum C Programming
    Replies: 8
    Last Post: 07-03-2007, 12:27 PM
  4. BOOKKEEPING PROGRAM, need help!
    By yabud in forum C Programming
    Replies: 3
    Last Post: 11-16-2006, 10:17 PM
  5. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 10:04 PM

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