Page 1 of 1

enet broadcast behaviour

Posted: Mon May 20, 2019 2:50 pm
by PGUp
I dont seem to understand host:broadcast() function.. is it to send a package from a peer to the server or send a package from server to all connected peer only? It seems to work both ways, but when I do it from the peer side, it fails most of the time to send it.. but it also works sometimes, what's happening?

Re: enet broadcast behaviour

Posted: Mon May 20, 2019 3:14 pm
by bobbyjones
It sends the data to all connected peers. For the client that is generally just the server. For the server its all of the connected peers. Actually, it does not send the data. It just queues it to be sent. The data is actually sent when host:service or host:flush is called. Are you doing both of those things?