Hi all,
I am using Sun Solaris 8/ gnu C compiler.
I need to listen to 6 network interface cards (6 ip addresses) on a specific port, is it possible to write a C program to listen to all 6 ip addresses? Do you think the following code can achieve that? Please comment, thanks all.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~`
struct sockaddr_in servAddr;
servAddr.sin_family = AF_INET;
servAddr.sin_addr.s_addr = htonl(INADDR_BROADCAST); //what does this ip address represent?
servAddr.sin_port = htons(5890);
servLen = sizeof(servAddr);
if(bind(sd, (struct sockaddr *) &servAddr, servLen)<0) {
perror("\nERROR : Failed to bind socket for the Listener ");
return ERROR;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~`
Thanks all!