Avoid sending udp packages to yourself

Maybe its a generally network question.
Im sending packages via broadcast two other players. Some of the received packages are my owns.
Is it possible to avoid this overhead by setting one of the packet attributes for example?

I’d recommend sending either a uuid or a combination of a small hash and
message id/timestamp. Uuid would be nice to identify clients, but a small
hash and message id can do the same job.

But also be aware that if you are having multiple clients broadcasting
frequently, it might be a sign off a strange/bad design, depending on what
you’re trying to do. On that not, what are you trying to achieve?

Sorry my new email so cut off some of your message my initial read.

Probably what you should do is assign a uuid to the payer hosting the game,
which would become the ‘game id.’. The server broadcasts this every few
seconds, which in turn advertises the IP, and your want to send the game
port if it’s unknown, as well as some type of game identifier so other
applications that may be listening for similar broadcasts can ignore it.

This is the type of strict I’d use for broadcasting:

struct GameBroadcastPacket
{
char identity[3]; // Small abbreviation of your game name
long port;
char game_id[32]; // probably could be shorter, but guid v4 is 128bit/32
bytes long
};

When a client receives this, they can trace the host IP from the packet,
and the host can ignore any broadcast with its own have id.On Mon, 12 Jan 2015 5:21 am Meldryt wrote:

Maybe its a generally network question.
Im sending packages via broadcast two other players. Some of the received
packages are my owns.
Is it possible to avoid this overhead by setting one of the packet
attributes for example?


SDL mailing list
SDL at lists.libsdl.org
http:// http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
lists.libsdl.org http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org/
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.orglistinfo.cgi
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org/
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.orgsdl-libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org