Bug? UDP Broadcast b4a

chams

Member
Licensed User
Longtime User
I made 2 small UDP clients for a program that I made before (using VB6 + winsock ocx) that broadcasts UDP messages on the x.x.x.255 adresse.
The one client is made with B4J v5.51 using jNetwork v1.20 as additional module. Works like a charm on Windows & OSX.
The other client is build with B4A v3.20 using the same jNetwork v1.20 additional module. Works well in "Debug Mode", but no in "Release Mode" : Some packets are received, some other not. If i put the desktop client and the Android device side by side, they work simultaneously when the Android app works on debug, but looses messages if in release mode.
I upgraded to B4A v7.30 and use the internal library "Network" v1.51 (switching to jNetwork 1.2 remains the same)
I get the same result :
Have you any idea about this change of behavior between release and debug mode ?
 

DonManfred

Expert
Licensed User
Longtime User
When it does not work: WHICH ERROR do you get? Check the Log (maybe the unfiltered log)
 

chams

Member
Licensed User
Longtime User
It's probably due to the broadcast address (for example 192.168.0.255). I thought that it was a bug, but it seems to be the implementation of the UDP stack on Android that is different than on other
(see : https://developer.android.com/reference/android/net/wifi/WifiManager.MulticastLock.html) and https://www.b4x.com/android/forum/t...y-v1-10-udp-supported.9099/page-3#post-154616)

if i just give the address of my device to the server's socket (for example 192.168.0.5) it works fine in "release mode" like in debug mode
:)
 
Top