enet broadcast behaviour

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
PGUp
Party member
Posts: 105
Joined: Fri Apr 21, 2017 9:17 am

enet broadcast behaviour

Post 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?
-
bobbyjones
Party member
Posts: 730
Joined: Sat Apr 26, 2014 7:46 pm

Re: enet broadcast behaviour

Post 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?
Post Reply

Who is online

Users browsing this forum: Google [Bot], Semrush [Bot], slime and 11 guests