sending and recieveing packets with dynamic size.

This is a discussion on sending and recieveing packets with dynamic size. within the Game Programming forums, part of the General Programming Boards category; if i have a packet like so Code: struct PACKET { unsigned char command; unsigned short length; char* message; }; ...

  1. #1
    Registered User
    Join Date
    Oct 2001
    Posts
    224

    sending and recieveing packets with dynamic size.

    if i have a packet like so

    Code:
    struct PACKET
    {
        unsigned char command;
        unsigned short length;
        char* message;
    };
    i know how to send it, but how would i recieve it? since i dont know the size of the packet before i recv() it?

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,532
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

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