I have a B4R program that sends IR signals to control devices in the house.
It receives commands through wifi commands using Sockets.
I can talk to the B4R program from multiple Android devices if I close the socket (in the Android device) after each command.
But the delay of reconnecting to send a command makes the Remote program to sluggish (doesn't perform as well as if I maintain an open connection).
I would like the B4R program to be able to handle multiple Open connections at the same time.
Basically my phone, my wife's phone and a table or two should be able to connect to the B4R program (and maintain and open connection)
I have looked at as many socket examples as I could. But still am unsure how to do this.
Do I create an array of WiFiServerSocket and/or WiFiUDP sockets in the B4R program?
Do I use different Control Ports? If different control ports how do I find out which port is being used on the Android side so it uses a different port?