I have two netports,
I want to the two ports can receive boradcast frame.
such as net 1 IP is 192.168.1.2,I want to only receive IP data to 192.168.1.2 or 192.168.1.255 address .
net 2 IP is 192.168.2.2,I want to only receive IP data to 192.168.2.2 or 192.168.2.255 address .
but if I init the IP,
for(i=0;i<2;i++)
{
.....
addr.sin_family = AF_INET;
addr.sin_port = 8812;
addr.sin_addr.s_addr = INADDR_ANY;
sendsock[i] = socket(PF_INET, SOCK_DGRAM, 0);
error = bind(sendsock[i], &addr, sizeof(addr));
....
}
the second port retun error != RTCS_OK.
if addr.sin_addr.s_addr = IPADDR(192,168.1.2) or IPADDR(192,168.2.2),
I only receive data to 192.168.1.2 or 192.168.2.2 ,I cannot receive data to 192,168.1.255 or192,168.2.255,
what shall I do?