Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hello all,
for anyone that still wants to find the solution:
The EADDRNOTAVAIL error indicates that the requested IP address cannot be assigned. This could be due to various reasons such as the IP address not being valid for the host or the IP address being unavailable.
In such cases, you’ll need to do some troubleshooting. Here is how I’ll go about this:
Make sure the IP address you are using is correct and assigned to the host on which you are running the program. If you want to bind the socket to all available network interfaces on the host, you can use the INADDR_ANY constant instead of specifying an IP address:
- sockaddr.sin_addr.s_addr = htonl(INADDR_ANY);
If you do this, the socket will bind to any available IP address on the host, and you don’t need to specify a specific IP address.
Make sure the port number you are trying to bind to is available and not already in use by another process. You can use the netstat or lsof command to check for any processes using the same port:
- netstat -tuln | grep 1234
If the port is already in use, you will need to choose a different port number or stop the process using the same port.
Binding to a port number lower than 1024 requires root privileges. If you are trying to bind to a port number in this range, make sure you are running the program with root privileges (e.g., using sudo).
Double-check that the device trying to bind the socket is indeed on the same network as the device you are trying to connect to. You can verify this by checking the IP addresses and netmasks of both devices.