i need a udp client wait for udp server to be created to connect and send first message.
const dgram = require('dgram');
const client = dgram.createSocket('udp4');
client.connect(27015, 'localhost', function() {
client.send(message, (err) => {
});
});
this code works when the udp server is already running, but do nothing if I first start the client and then server. I need it to work in both cases.