UDP is a connection-less protocol. In my server, I am using two sockets in listening mode:
sfd3000=CreateUDPSocketAndListen(3000);
sfd14000=CreateUDPSocketAndListen(4000);
I am using
socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
to create the sockets.
I am receiving the request using one socket
recvfrom(sfd3000, reqbuff,1024, 0,(struct sockaddr *)&clientinfo, (socklen_t *)&sinfolen);
Can I use the other listening socket to send the response, using the same clientinfo structure
sendto(sfd4000,respbuff,resplen, 0,(struct sockaddr *) &clientinfo, sinfolen);
Is this possible in UDP as it's a connection-less protocol?