Q: For above do I have to use two different sockets to handle the sending and receiving?
A: No, absolutely not. One socket can do both "sendto()" and "recvfrom()".
Q: Can it be done without threading?
Q: Considering the server should be listening all the time to minimize the already possible packet losses from using UDP?
A: In this scenario, it doesn't sound like "packet loss" would really be an issue. If it were, the easiest solution is to implement a simple "ACK/Retry" protocol". Or switch from UDP datagrams to TCP connections.
Read Beej's Guide to Network Programming:
'Hope that helps .. PSM