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.....)
at server side:
and at client side:
n = send(sock, (void *) &r1, sizeof(r1),0);
if (n < 0) perror("ERROR in send()");
n = recv(sock, (void *) &r1, sizeof(r1),0);
To understand how udp sockets works look at this picture: