Hii all
I am novice in socket programming..
I had two programs. RECEIVE and SENDRECEIVE.
In RECEIVE I simply write the code for receiving data from a program acting as server using resvfrom(.....) and in the later one I had written the code for receiving some msg from a program acting as server using resvfrom(.....) also i am sending same data back to that server program using sendto(......).
I am using linux machines with multicast address 224.0.0.5 and port 4545.
My program is running well but problem is that is:
first my RECEIVE program is receiving data then my SENDRECEIVE program receiving and sending data.
but it runs infinety.....I enclosed my code in while(1){.......}.
now what is the prob????
Is my close (.....) socket is not called for SENDRECEIVE program.
If yes how will i close my socket using which conditions so that it will terminate after receiving msg from server and sending it back to RECEIVE program.....
"I cant send the entire code this time but the logic is ... after setsocketopt(.....)
while (1)
//receiving from server int
status=resvfrom(sock,buffer,MAxBUFFERSIZE,0,(struct
sockaddr )&addr,&socklen); {.....
{..... .. .. } //sending back to
server int count=
sensto(sock,buffer,MAxBUFFERSIZE,0,(struct
sockaddr )&addr,&socklen); {... .. .
}
}
will u please help me as soon as possible..."