Hi ,
I'm creating an SMS application ( It's not a real SMS system , it will work with computers which they can send to each other short messages through server )
where
- The client will type the message ( doesn't exceed 160 ) and the recipient client IP address
- The client will send through the server
- A server receives messages from clients, stores them, and forwards them when the recipient client is connected
The problem :
Client :
1/ How to send the recipient client IP to server ?
In sendPacket , the IPAddress will be server address ( client send through the server ) , I also need to put the receiver IP somewhere where server will forward the msg to recipient client
but I didn't know where to put it
Server :
1/How multiple client can connect with the server ?
I read about the threads but I didn't know where to put it
2/ How the server check if reciever is connected ? I found this code but I'm not sure about it
I found about method Reachable but for some reason it always return false
Here the complete code
Client
Server :
Thank you and I hope you help me