I have an Android app that needs to let multiple socket communication. here is the basic work around:
My application( Say Server) is a service which will run as a sever socket. other application can connect to it on predefined port. There can be a multiple connection say client 1, client 2.
So when client 1 send hello, server will process this and should send reply back to client 1.
Currently I am able to connect server for client 1 and client 2. I have created input , output buffer for same. But I am not sure how server will detect from which it has received "hello".
I was referring this example , but still not clear how to use that solution:
How can I handle multiple clients connected to a server using sockets?