I need to send some text message from my android app to my windows c# app. So far I have figured out a TCP connection using:
Socket socket = new Socket(serverAddr, Integer.parseInt(myPort));
On my client side (java), and:
IPAddress ipAd = IPAddress.Parse(ip);
myList = new TcpListener(ipAd, Int32.Parse(port));
myList.Start();
On my server side (c#). Here is all the code
The problem is that i cant afford to retrieve the servers ip on each installation... and a static ip is not an option. So i started to search a broadcast solution, but there are a lot of possible option on the web like:
MulticastSocket
UdpClient
And other ones that i cant tell the difference between them or the best for my case, can any one help me out with this? any explanation or code would be perfect.
For the last, if i am trying to set an UDP connection, do i need an specific port? or anyone should be fine?