Search code examples
javanetwork-programmingudpudpclientapache-mina

Send data back to client with UDP using Apache Mina


I am using Apache Mina to create a server to accept UDP Client requests. I have read the Official documentation provided by Apache Mina regarding UDP Server & UDP Client. However, I wished to know when the server receives a message, can I write back to the UDP Client using the same session(I know UDP is connectionless at Network Layer, however I can get the IP and PORT of the remote host at Application Layer) such that UDP Client receives a message. I know this is possible is TCP but am a little confused about UDP. I know this may not exactly be Java based but more Network Layer based question. Would appreciate if somebody could clear this for me.


Solution

  • I got the answer to the same and thought i would share.

    UDP is connectionless however I can use the same session which I have in Apache Mina to write to the session. I tried it as a sample also and it worked.