Receiving multiple multicast feeds on the same port – C, Linux

After some years facing this linux strange behaviour, and using the bind workaround describe in previous answers, I realize that the ip(7) manpage describe a possible solution : IP_MULTICAST_ALL (since Linux 2.6.31) This option can be used to modify the delivery policy of multicast messages to sockets bound to the wildcard INADDR_ANY address. The argument … Read more

Can’t connect to Postgresql on port 5432

You have to edit postgresql.conf file and change line with ‘listen_addresses’. This file you can find in the /etc/postgresql/9.3/main directory. Default Ubuntu config have allowed only localhost (or 127.0.0.1) interface, which is sufficient for using, when every PostgreSQL client work on the same computer, as PostgreSQL server. If you want connect PostgreSQL server from other … Read more

Make docker use IPv4 for port binding

As @daniel-t points out in the comment: github.com/docker/docker/issues/2174 is about showing binding only to IPv6 in netstat, but that is not an issue. As that github issues states: When setting up the proxy, Docker requests the loopback address ‘127.0.0.1’, Linux realises this is an address that exists in IPv6 (as ::0) and opens on both … Read more

How to find an available port?

If you don’t mind the port used, specify a port of 0 to the ServerSocket constructor and it will listen on any free port. ServerSocket s = new ServerSocket(0); System.out.println(“listening on port: ” + s.getLocalPort()); If you want to use a specific set of ports, then the easiest way is probably to iterate through them … Read more