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
Party member
Posts: 105
Joined: Fri Apr 21, 2017 9:17 am

enet broadcast behaviour

Post by PGUp » Mon May 20, 2019 2:50 pm

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?

Party member
Posts: 728
Joined: Sat Apr 26, 2014 7:46 pm

Re: enet broadcast behaviour

Post by bobbyjones » Mon May 20, 2019 3:14 pm

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?
Do you frequently have great ideas but immediately lose them? Check out the MVP for my website called IdeaVault. It is designed to solve that problem. Desktop browsers only currently.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 31 guests