I have an application that after being started send all the messages that it generates to a UDP socket created on port 7865.

Now I have to write a logger function which reads all these messages and saves them into a file as well as displays them.

The data is sent as a struct of the form

typeded struct{
int task,len,type,resource;
} Resc;


please help