you can use a structure to save different data types for different clients.....and send it via send() and recieve via recv()....
but you should have struct both to client and server.....(better in external header file.....)
e.g:
mystruct.h :
Code:
struct data{
int i;
char info[50];
}r1;
at server side:
Code:
r1.i=10;
n = send(sock, (void *) &r1, sizeof(r1),0);
if (n < 0) perror("ERROR in send()");
and at client side:
Code:
n = recv(sock, (void *) &r1, sizeof(r1),0);
printf("i=%d",r1.i);
To understand how udp sockets works look at this picture: