How to implement a reliable IM instant messaging application
There are many IM real-time applications currently, and the following ideas can be found:
If you have a server, you can use multiple clients to connect to the server. The server forwards messages and uses persistent connections. XMPP protocol can be used. For servers, see open source OpenFire.
If you do not have a server, you can use a third-party IM platform to connect to the platform through a client, so that the platform can forward messages on its behalf. This advantage is that you do not need to develop and maintain the message push process on your own, but the communication performance is significantly affected by third parties.
With the help of the huanxin platform, we can develop an Android APP and a web client, and the web Client is mounted on the Sina server. In this way, we can use CS and BS for point-to-point communication, group chat, including text sending, images, videos, and calls.
The information about the ID and password is retained. Therefore, we can create another server to keep the user information on our own server, and the ID and password are encrypted and mapped to the ring information platform. In this way, the user logs on to our server and indirectly connects to the ring Information Server for communication.
If we want to implement a chat room, we can do this by creating a chat room where users can log on to the group chat room.