c sendto function sets “network is unreachable” errno in linux2.6.29
Your code is fine. The problem is in your network administration.
You are missing a default route. The default route might be provided by your DHCP server, you might have to specify it in your network config files, or you might have to issue a command like route add default gw 192.0.2.1
.
UDP broadcast breaks after some time on Linux 2.6.33.9 rt
Binding the socket to a device specific broadcast address, in my case 192.168.5.255, fixes the bug. I have no idea why this happens but it works.
IOException Network is unreachable
The network unreachable message is an ICMP message. When a host tries to reach another host on a different network, it sends the layer-3 packet to its configured gateway. If the gateway ( or any router in the path) doesn't know how to reach the other network, it will generate an ICMP message and send it back to the host.
Related Topics
Can't Run Dmidecode on Docker Container
Cannot Connect to The Docker Daemon at Unix:///Var/Run/Docker.Sock
Which Tool Has Replaced Gatttool in Bluez5
How to Get The Union of Two Arrays in Bash
Valueerror: Namespace Gtk Not Available
Bash Separate Parameters with Specific Delimiter
Creating User Passwords from an Ansible Playbook
Ffmpeg Combining Images to Video and Streaming in One Command Line
How to Run a Linux Executable from Any Directory in Terminal
Putting Extensions in a Certificate in Openssl
Cvs Error: Failed to Create Lock Directory... Permission Denied
Xdotool Type Takes Ages and Causes Entire Desktop to Freeze
How to Continously Run a Unix Script in Background Without Using Crontab.