[ENet-discuss] Some important questions!

Peter Soxberger Peter.Soxberger at gmx.net
Sat Oct 18 04:04:09 PDT 2008


Thanks for your fast answer!
You helped me a lot!

Peter Soxberger

-------- Original-Nachricht --------
> Datum: Fri, 17 Oct 2008 23:48:08 -0700
> Von: Lee Salzman <lsalzman1 at cox.net>
> An: Discussion of the ENet library <enet-discuss at cubik.org>
> Betreff: Re: [ENet-discuss] Some important questions!

> Er, for 3), make that:
> 
> memcpy(buffer, packet->data, min(packet->dataLength, 500));
> buffer[min(packet->dataLength, 500-1)] = '\0';
> 
> Lee
>  
> Lee Salzman wrote:
> > 1) enet_host_broadcast IS implemented as sending the same exact packet 
> > to every connected peer.
> > It's more just a convenience function for a very common usage than 
> > anything that is super-optimal.
> >
> > 2) packet->dataLength
> >
> > 3) memcpy(buffer, packet->data, min(packet->dataLength, 500)); 
> > buffer[500-1] = '\0';
> >
> > Lee
> >
> > Peter Soxberger wrote:
> >> Hi!
> >> I have 3 small but important questions:
> >>
> >> 1) Is enet_host_broadcast faster/better/... than sending a packet 
> >> with enet_peer_send to every connected peer?
> >> 2) How can I get the real size of a sent packet so that I can 
> >> calculate the duration (sizeof always returns 4 ^^)?
> >> 3) How do I get the whole content of a packet (if it's content is a 
> >> non null terminated string) and save it into a char array?
> >> I always did it like this: sprintf_s(buffer,500,"%s",packet->data); 
> >> but this only works with a null terminated string...
> >>
> >> Thanks for your help!
> >>
> >> Peter Soxberger
> >>   
> >
> > _______________________________________________
> > 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

-- 
Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten 
Browser-Versionen downloaden: http://www.gmx.net/de/go/browser


More information about the ENet-discuss mailing list