FLYFISH TECHNOLOGIES.
Sockets need to be connected, then you can broadcast to peers.
This is not true for UDP.
TCP/IP sockets need a connection, client to server. UDP does not have an idea of a connection, it can just send packets.
One can use port numbers above 1024 (Is it that exact number, I forget?) without being root. So 3400 should be OK.
Here is an example of sending UDP packets in JavaScript for node.js:
Code: Select all
var dgram = require('dgram');
var message = new Buffer("Some bytes");
var client = dgram.createSocket("udp4");
client.send(message, 0, message.length, 41234, "localhost", function(err, bytes) {
client.close();
});
I'm not really familiar with broadcasting.
Memory in C++ is a leaky abstraction .