MQTT makes it very simple to implement communication between multiple devices. It is not really a server to client connection but rather clients to clients with very good control on everything.
Thanks a lot
I understood MQTT is the solution of remote client to client connections but as I implemented based on socket it's hard for me to change. I got an idea asking your opinion.
I would be grateful to you.
As we know the problem of connection between two clients which are not in the same network is that it's hard for us to find their IP address. what if we put their IP address in online database and tell both sides to give their new IP address to server every couple of hours? It's not the answer lonely because IP address may change just after sent to database by turning modem off/on, for example. Therefore, we need a check code to make sure if the destination client got the order or not, then we check the IP address again. logical code is like this:
while( you have IP address of destination)
send stuff to destination
if not(check code) then
get IP address from database
else
return true
end if
loop