This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi, I'm coding a chat application (using UDP)which communicates through a chat server. I need to uniquely identify the communication path between the workstations involved in a end-to-end chat(through the server)session.
Pls advise me in this regard, as to how i can identify a particular communication session in UDP
If I understand the question correctly, you can use the getSocketAddress() method of the DatagramPacket object to uniquely identify the source. Bill
Joined: Aug 04, 2006
Hi, yes, this is correct incase i'm using just a 2 tier arhitecture and the communication is between the client and server. But my case is, a client communicates with another client through the server. And i need the server to monitor a particular session as there will be many "client to client" sessions through the server. In TCP this could be easily done, but i want to use UDP, and i cant seem to uniquely maintain a particular session. I cant seem to get the logic behind this. I need to recognize a particular session because, i want to dynamically add more clients to a particular session(something like conferencing).
Pls help me with this regard
Author and all-around good cowpoke
Joined: Mar 22, 2000
Each message packet of bytes must contain routing information so the server can send it to the correct client(s).
You need to come up with a design for a standard fixed block of data that will be transmitted with each packet in addition to the variable chat data. Since this is UDP, each packet must stand alone AND the application can not break if a packet is lost.
Taking the anthropomorphic approach, imagine that you are the server getting a single slip of paper at a time - what do you need to know to send it to the right recipient?
It is an interesting problem, please let us know what you come up with.