Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20169] Ti.UDP module, broadcast doesn't work

GitHub Issuen/a
TypeBug
Priorityn/a
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsn/a
Reporternicolomonili
AssigneeUnknown
Created2015-09-08T09:24:27.000+0000
Updated2018-02-28T19:55:54.000+0000

Description

Ti.UDP 1.2.0 : https://github.com/appcelerator-modules/ti.udp/releases/tag/ios-1.2.0 Question on Q&A : https://developer.appcelerator.com/question/163579/broadcast-of-udp-module-for-ios-not-working Issue on Github: https://github.com/appcelerator-modules/ti.udp/issues/4 This code doesn't work for broadcast messages :
var socket = UDP.createSocket();
socket.start({
       port: ...
});
socket.sendBytes({
       data: [....,....]
});
socket.close();
If i add the host , the message is sent. But it's not correct for broadcast messages
var socket = UDP.createSocket();
socket.start({
       port: ...
});
socket.sendBytes({
       host : "...",
       data: [....,....]
});
socket.close();
*UPDATE 1* - I "solved" the problem of the broadcast message in this way
var socket = UDP.createSocket();
socket.start({
       port: ...
});
socket.sendBytes({
       host : "239.255.255.250",
       data: [....,....]
});
socket.close();
*UPDATE 2* - The *Ti.UDP 1.2.0* doesn't seem to work on Android

Comments

  1. Michael Gangolf 2015-11-17

    adding https://gist.github.com/chancyWu/8349411#file-send-and-receive-a-broadcast-udp-packet-in-c-or-objective-c-L16 worked with 255.255.255.255

JSON Source