Closed BILLXZY1215 closed 2 years ago
Hi, I'm trying to rebind two used sockets, it works fine in android, but not in iOS.
const app = dgram.createSocket({type: 'udp4', reuseAddr: true}); const server = dgram.createSocket({type: 'udp4', reuseAddr: true}); //First Bind, everything is ok app.bind(app_port, err => { if (err) { throw err; } console.log('app bound to port', app_port); }); server.bind(server_port, err => { if (err) { throw err; } console.log('server bound to port', server_port); }); // Send Data app.send(open_msg, 0, open_msg.length, server_port, URL, function (err) { if (err) { throw err; } console.log('app sent data, starting frame'); }); app.on('message', async (data, rinfo) => { // Some Tasks }) // On sometime: rebind app.bind(app_port, err => { if (err) { throw err; } console.log('app bound to port', app_port); }); server.bind(server_port, err => { if (err) { throw err; } console.log('server bound to port', server_port); }); // And then send another msg app.send( close_msg, 0, close_msg.length, server_port, URL, function (err) { if (err) { console.warn(err); throw err; } console.log('app sent data, closing frame'); }, );
This is how it behaves in iOS:
This is how it behaves in Android (normal):
The codes shown above have this segment:
app.on('message', ...
It works fine in android, however, in iOS I did not receive any listened callbacks, it seems this listening function is not working...
Any workaround? Thanks.
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community attention? This issue may be closed if no further activity occurs.
Description
Hi, I'm trying to rebind two used sockets, it works fine in android, but not in iOS.
Steps to reproduce
Current behavior (console log when rebinding)
This is how it behaves in iOS:
Expected behavior
This is how it behaves in Android (normal):
About sending data frames
The codes shown above have this segment:
It works fine in android, however, in iOS I did not receive any listened callbacks, it seems this listening function is not working...
Any workaround? Thanks.