Correct the phprpc source code to support string type conversion of collection classes

Source: Internet
Author: User
Modify the phprpc source code to support string type conversion of the collection class. in terms of remoting protocol, hessian and phprpc are mostly used, but phprpc has a much higher conversion efficiency than hessian. The following link compares the serialization/deserialization efficiency of both: http://www.iteye.com/t modifying phprpc source code to support string type conversion of collection classes
In terms of the remoting protocol, hessian and phprpc are mostly used, but phprpc has a much higher conversion efficiency than hessian. The following link compares the serialization/deserialization efficiency of the two:
Http://www.iteye.com/topic/333720
I also tested and compared the data types supported by the two based on the development requirements. The following is a summary:

Hessian
1. The set cannot contain char arrays;
2. apart from 1, it perfectly supports resolution conversion of various sets and element types;

Phprpc
1. the value in the set is string type and must be converted by the customer. the code is new String (byte []) test. getMap (). get ("1"), "UTF-8 ")
2. except byte [], the set does not support other arrays, such as int [], float [], and char [].

At first glance, hessian is enough. Although hessian does not support conversion of char arrays in the set, it is less likely to be used in practical use. However, the phprpc with a high efficiency of N times hessian does not have to blame, so I started to study the code and tried to solve the problem that the value in the set is a string type value from the source code.
In fact, the cause is that PHPRPC does not correctly identify the string type of the neutron element in the unserialize process. In PHPRPC, the class responsible for serialization and deserialization is PHPSerializer. java. Therefore, it is not difficult to solve the problem after locating it. N thousand words are omitted here, which is actually the problem of adding a line of code, but it consumes a whole afternoon's energy. The following three jar files of phprpc are required for compiled spring2.5: phprpc_client.jar phprpc_spring.jar phprpc. jar.
Download can be used.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.