Godot: PacketPeerUDP does not support broadcasting (255.255.255.255)

Created on 17 Jul 2018  路  6Comments  路  Source: godotengine/godot

Godot version:
3.0.5

OS/device including version:
Device: Samsung Galaxy S6 (SM-G920F) OS: Android 7.0

Issue description:
When trying to broadcast packets (255.255.255.255) on android godot returns the FAILED error. My phone can, however, receive packets that are broadcasted. Running the project on Windows does not result in the error, and the packets are sent.

Steps to reproduce:

var udp_peer = PacketPeerUDP.new()
udp_peer.set_dest_address("255.255.255.255", PORT_OF_CHOICE)
udp_peer.listen(PORT_OF_CHOICE)

udp_peer.put_var(VARAIBLE_OF_CHOICE) #returns FAILED
udp_peer.put_packet(PACKET_OF_CHOICE) #returns FAILED

Minimal reproduction project:
UDP_BROADCAST_FAILED_PROJ.zip

archived bug network

Most helpful comment

@Joleeee There are unofficial daily builds available (https://hugo.pro/projects/godot-builds/), but of course those are not stable releases.

This fix as is will be included in Godot 3.1, which does not have a release date set yet.

However, it is also being considered for cherrypicking into a stable branch (Godot 3.0.x) release.
If it is cherrypicked, it will be available before that. If this is important to you, you may want to comment in the merged PR that you would like to have it cherrypicked.

All 6 comments

I have tested for a while now and it seems like I can connect sometimes, although very rarely. I am also fairly sure it's not permissions as I have turned lots of them on. I think the problem happens when you call the set_dest_adress() and/or listen() functions.

I had the same issue with Windows and Linux a few days ago. If I used 255.255.255.255 it just didn't send any packet. 192.255.255.255 however did work. So I guess it's not just related to Android...

CC @godotengine/network

Already fixed in master via #19378 .

@Faless Thanks for fixing my problem. I am new around here, and, it might be well known, but do you have any idea when this will be released? I see it was merged 1 month ago and the last build(3.0.5) was released much later than that. Perhaps I should just compile it myself.

@Joleeee There are unofficial daily builds available (https://hugo.pro/projects/godot-builds/), but of course those are not stable releases.

This fix as is will be included in Godot 3.1, which does not have a release date set yet.

However, it is also being considered for cherrypicking into a stable branch (Godot 3.0.x) release.
If it is cherrypicked, it will be available before that. If this is important to you, you may want to comment in the merged PR that you would like to have it cherrypicked.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Zylann picture Zylann  路  3Comments

nunodonato picture nunodonato  路  3Comments

mefihl picture mefihl  路  3Comments

ducdetronquito picture ducdetronquito  路  3Comments

n-pigeon picture n-pigeon  路  3Comments