We have two servers that need to communicate with each other.
Something like this:
server1
public int getSomedataBoth() {
return this.someData + Server2.getSomeData();
}
public int getSomeData() {
return this.someData;
}
server2
public int getSomedataBoth() {
return this.someData + Server1.getSomeData();
}
public int getSomeData() {
return this.someData;
}
Therefore, any client will receive the sum of someData regardless of which server it is connected.
How can I implement this communication?