Problem with send UDP package on TizenRT
I try to use function uv_udp_send from UDP support but I have a problem and always receive -1.
https://github.com/Samsung/libtuv/blob/74281413e95d50c2d06ce616ef81da70625c27fe/src/unix/udp.c#L300
The same function on Raspberry Pi work correct but on TizenRT UDP package isn't sending.
Are you sure that UDP work correct? I don't see any test for UDP in project. Could you add tests or simple example to confirm that UDP works correct?
@umaciek Could you check again after #88 is landed?
@glistening I tested with your patch and now function always return 0 and UDP package isn't send
Do you use this function directly?
The following small test works on RPi2 and NuttX:
var dgram = require('dgram');
var port = 12345;
var server = dgram.createSocket('udp4');
server.on('message', function(data, rinfo) {
console.log('server got data : ' + data);
});
server.bind(port);
var client = dgram.createSocket('udp4');
client.send("hello", port, 'localhost');
NuttX shell output:
nsh> iotjs /test/run_pass/udp.js
server got data : hello
See: https://github.com/Samsung/iotjs/issues/1171 These UDP errors can be caused by invalid address string conversions similar to recorded in my debugging session.
@umaciek Does @zherczeg and @pmarcinkiew 's comment help you? I can send udp packet using IoT.js on TizenRT. If you still have problem, please give us the full test source.