I create a socket of the form:
fd = socket(AF_INET, SOCK_RAW, IPPROTO_UDP);
then proceed:
bind(fd, (struct sockaddr*)&saddr, sizeof(struct sockaddr_in))
where saddr supports INADDR_ANY and is from the AF_INET family
The problem I have is that after listening with a loop of the type:
while(true) {
char mess[BUFFSIZE+1];
int content_size = recv(fd, mess, BUFFSIZE, 0);
mess[content_size] = 'fd = socket(AF_INET, SOCK_RAW, IPPROTO_UDP);
';
std::cout<<"recibí el mensaje: "<<mess<<std::endl;
}
Once I receive a continuous message, I receive it during all the subsequent tours of the loop
EDIT: I program in DEBIAN.