I have Chat Client Server Application, which we are scaling up. so I need to do interserver communication between two chat servers.
Problem is: Suppose there are two servers A and B. now Suppose client
C1 is TCP Connected with Server A and Client c2 is TCP connected with
Server B.
Then problem is: as a same appication client C1 and c2 should be able to identifty each other as logged in and available online, but
that is not happening becase there is no inter server
communication.Possible solution no 1 is : Log in server A and Server B into each
other using TCP connection. Here i can forward the login XML
message(String) and DataInputStream to other server through the
TCP connection. so every login is transfered to the other server so
that every client is accessible to each server and Client C1 can see
Client C2 as logged in(online) and vice versa.Problem with Solution 1 is: Suppose now client C1 can see Client C2 as
available online and Client C1 sends message to Client C2. what will
happen is Server A Will try to write to DatainputStream for the client
C2 which is established on Server B and not on Server A. here is the
problem the code will break here and Server A will not be able to send
messages to Client C2.
Any inputs will be appreciated .
Thanks
You could take a look on how the IRC servers implements such kind of functionality. I believe that you just need to write another server which will handle your servers as the clients and request to them in order to find the concrete user.
https://www.rfc-editor.org/rfc/rfc2810