C programming: Sending data structures over sockets?

This is a discussion on C programming: Sending data structures over sockets? within the C Programming forums, part of the General Programming Boards category; Hi, Is there an easy way in C of sending a struct over a socket, where the struct contains a ...

  1. #1
    Registered User
    Join Date
    Aug 2002
    Posts
    1

    C programming: Sending data structures over sockets?

    Hi,
    Is there an easy way in C of sending a struct over a socket, where the struct contains a pointer to a char buffer(length of the char buffer can vary) and also contains pointers to other structs(these structs must be transmitted as well).

    Thanks

  2. #2
    Registered User
    Join Date
    Jul 2002
    Posts
    273
    pointer to the string is obviously meaningless to the machine you're sending it to so I would suggest just sending a buffer with the appropriate values one after another. The string would be one of those values.

    Of course it is a little bit nicer to come up with a real data format like XML but heck that's probably overkill right?
    always looking, make an offer. get me out of this place.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. sending data over UDP from serial port
    By forumguy in forum Linux Programming
    Replies: 0
    Last Post: 04-25-2009, 02:10 PM
  2. How to transfer data structures over net ?
    By jabka in forum C Programming
    Replies: 5
    Last Post: 04-12-2009, 11:46 AM
  3. Replies: 2
    Last Post: 02-28-2006, 01:01 PM
  4. Need some help regarding data structures
    By Afrinux in forum C Programming
    Replies: 15
    Last Post: 01-28-2006, 04:19 AM
  5. Data Structures Debugging
    By 0rion in forum C Programming
    Replies: 15
    Last Post: 08-28-2004, 10:36 AM

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