i am trying to make a project about sending and receiving sound states from clients to server and the server is ending back acknowledgments,I am using UDP to make the communication much faster,in the server java class i have a unicast class inside a multicast class,the multicast class is for getting the clients joining the multicast group then it will pass the IP and the Port of the client class to run the sound state sending and receiving, when i run the one client every thing seems ok but when i run the second client i obtain and error"Address already in use, cannot bind" and the error is in line 139 which is datagramSocketrecieving=new DataSocket(getsocket());
so my question is can i use the same socket in the server side to receive packets from different clients and of course if you see something wrong or can be modified to be more efficient let me know, thank you
here is the code of the "server class" on github cause its more than 200 lines
https://github.com/kameluo/tfmserver/blob/master/src/projectserver/MulticastthreadRun2.java