I've show this to you as an example. Don't recommend it because the interfaces names change from system to system... Here, in my machine (Linux), my network card interface is enp3s0, not eth0 (I did some editing in the previous message!) - Virtual machines name their own interfaces in a different way... Containers, like those of docker, also do the same...
Use 0.0.0.0, as the first example, or inform the desired IP address from command line. It is better. As I said, getting the IP for the NIC isn't portable (each OS do in a different way - I think, but not sure, that code using getnameinfo() will not work on MacOS, for example)...