Find the answer to your Linux question:
Results 1 to 3 of 3
I have been following Beej's Networking Tutorial 2.3.1 at ( http://www.ecst.csuchico.edu/~beej/guide/net/html/ ). I am currently using his last example on the "Synchronous I/O Multiplexing" selectserver.c but changed it to handle ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie
    Join Date
    Nov 2004
    Posts
    208

    Network Protocol Programming Woes :S.............


    I have been following Beej's Networking Tutorial 2.3.1 at ( http://www.ecst.csuchico.edu/~beej/guide/net/html/ ). I am currently using his last example on the "Synchronous I/O Multiplexing" selectserver.c but changed it to handle unconnected datagram sockets.

    Currently my server just sends a "1" character to the client and the client responds with a double[32][4]. This is working fine. What am interested in is expanding the protocol to include other instructions. However Beej didn't cover any protocol programming. So am wondering if anyone knows any good tutorials on protocol programming. Or even a good protocol library/suite that can be easily used with Beej's selectserver.c.

    Below is a protocol idea I have in mind for my application of a Real-Time Linux Cluster Monitor:

    Server Commands:
    "C" - Retrieve Group Of Hosts Processor Statistics
    "M" - Retrieve Group Of Hosts Memory Info
    "A" - Retrieve Both Group Of Hosts Processor & Memory
    "X" - Shutdown Client Program
    "G:1:2:3:4:5" - Change Group Of Hosts To Monitor
    (Should I send integers since they're smaller than characters?)

    Client Replies:
    "C", double[32][4] // User, System, Nice, Idle
    "M", double[32][8] // Used, Shared, Buffers, Cache, Swap Used, Load Avg (1min, 5min 15min)
    (Is this the best way? Client sends a character then a double array? Or should I packaged them up in a structure? Is it possible to send a structure? Since we're sending 32x8 doubles would compression help lowering the network over-head? Is the character id reply unnessary? Would omitting the character id in the reply be okay?)
    "A" struct {double[32][4]; double[32][8];}
    "X"

  2. #2
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    There isn't really such a thing as "protocol programming", and thus there's no library for it either.

    Since you only mention "protocol programming" as a general concept, and that concept doesn't really exist (except possibly in an extremely fluffy interpretation), it's kind of hard for me to go into any details. What, more exactly, is it that you're having trouble with?

  3. #3
    Linux Newbie
    Join Date
    Nov 2004
    Posts
    208
    So basically everyone programs their own protcol.

  4. $spacer_open
    $spacer_close

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •