Last Updated: 2013-03-30
Note:
At the beginning, this project adopted the open-source XMPP protocol and the open-source gloox library. However, in the past year, with the Development deepening, we gradually began to find some shortcomings of gloox. For example, to implement the most basic user registration user login function, we had to implement two classes, then, reload the functions in these two classes to write the implementation logic. Now our implementation method is simplified to a class, which separates different logics into different functions. If you only need to extend these functions to add business logic, the implementation of business logic itself becomes more concise and lightweight, and easier to understand. The following two figures can be compared:
| Gloox implementation |
Implementation of xproerimclient |
|
|
Network communication protocol module:
We have also made significant improvements in server design:
The first is the executable file size. The size of openfire is 40 MB, and the total size of xproerim-server is only 1.5 MB, saving a total of 26 times. Performance has increased by 50 times. Because xproerim-server all adopts C ++ development, openfire adopts Java development. Xproerim-server can manage the memory of every 1 byte by itself. At the same time, the memory pool is used to save the memory and the system will not frequently clean up the memory.
Compared with openfire, xproerim-server can use a large number of high-performance system I/O or network I/O, which improves the performance by an order of magnitude. The functions used by openfire are packaged in Java, causing a lot of performance loss and unnecessary system resource overhead during calls.
The second is cross-platform consideration. We have considered cross-platform support. during development, we should try to consider writing code irrelevant to the platform, in this way, xproerim-server can support both Windows and Linux,
Third, we separate the database from the program. This design makes it easy for xproerim-server to be seamlessly integrated with existing user databases.
Fourth, the high-performance communication model-iocp (Windows) and epoll (Linux) can bring the server performance to its limit while occupying a very small amount of server resources.
Fifth, with the distributed architecture design, server load capacity is of great concern to any Internet companies. Xproerim-server supports the free expansion of servers and distributes the load pressure to multiple servers, thus improving the load capacity of the entire system and enabling the system to meet the business development needs of enterprises.
Major improvements:
1. Optimize the main panel
2. Complete the login process.
3. Complete the message process.
4. Discard gloox and openfire and completely redesign the server.
Main Interface:
Quick friend search:
Chat interface: