libtuv icon indicating copy to clipboard operation
libtuv copied to clipboard

Problem with send UDP package on TizenRT

Open umaciek opened this issue 8 years ago • 5 comments

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 avatar Aug 28 '17 17:08 umaciek

@umaciek Could you check again after #88 is landed?

glistening avatar Aug 29 '17 02:08 glistening

@glistening I tested with your patch and now function always return 0 and UDP package isn't send

umaciek avatar Aug 29 '17 07:08 umaciek

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

zherczeg avatar Aug 31 '17 09:08 zherczeg

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.

pmarcinkiew avatar Sep 05 '17 10:09 pmarcinkiew

@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.

glistening avatar Sep 20 '17 06:09 glistening