I want to receive the data from different ip addr with different port numbers and the reading the data is in infinite loop?
Advertisement
Answer
Can’t be done. It would conflict with all other bound sockets on the system.
If what you really want to do is read any traffic coming in through the network interface, you need a packet capture library such as libpcap.