[ENet-discuss] Extracting Packet data

Ruud van Gaal ruud at racer.nl
Wed Jan 21 02:34:00 PST 2015


The simplest would be just to use something like 'char buf[256];
sprintf(buf,"My message");' and send the whole 256 bytes. However, this
assumes packet size and flexibility aren't issues. If you want to send more
flexible data than that, indeed look up serializing on Google.

On Tue, Jan 20, 2015 at 11:24 PM, Andrew Resch <andrewresch at gmail.com>
wrote:

> Typically when sending data over the network, you'll want to serialize the
> data first.  On the other side when you receive the data, you'll want to
> deserialize into the format you expect.  There are plenty of ways to
> accomplish this and lots of libraries that could help, I would just suggest
> that a search should find yourself plenty of examples and information on
> the internet.
>
> On Tue, Jan 20, 2015 at 5:03 AM, akawo omojo <cybrat at gmail.com> wrote:
>
>> I just started using Enet recently for my online card game(Whot) which is
>> common in my region(Africa).My question might sound noobish but here it is.
>>
>> I send a packet from my client to my server and the packet is well
>> received .I have been having troubles on knowing how to unwrap the packet
>> data so i get back my string information i sent . Any help will be welccome
>> or i can be directed to any tutorial on Enet to extract game events fron
>> the packet back to strings.
>>
>> Thanks in advance.
>>
>> Akawo Omojo
>>
>> _______________________________________________
>> ENet-discuss mailing list
>> ENet-discuss at cubik.org
>> http://lists.cubik.org/mailman/listinfo/enet-discuss
>>
>>
>
> _______________________________________________
> ENet-discuss mailing list
> ENet-discuss at cubik.org
> http://lists.cubik.org/mailman/listinfo/enet-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cubik.org/pipermail/enet-discuss/attachments/20150121/19e8d321/attachment.html>


More information about the ENet-discuss mailing list