3 ms·
Just curious by looking at the snippets of code, why not make the code address-family agnostic? The server should listen on both ipv6 and ipv4 at the same time
by simon_vetter 14y ago
Just curious by looking at the snippets of code, why not make the code address-family agnostic?
The server should listen on both ipv6 and ipv4 at the same time (on linux at least, if you open a listening socket on ipv6, it will also accept ipv4 connections, so no need for duplicate code) and send advertisements on ipv6 and ipv4 as well.
The client should listen to advertisements on both address families, connect to whatever addresses it discovers : ipv6 first, then ipv4.
Also, having your own discovery/advertisement mechanism has its merits, but have you considered avahi/zeroconf/bonjour?