Analysis of the content processing process of AMF Protocol

Source: Internet
Author: User

If you are familiar with Flash, you may know the AMF protocol. The use of this protocol is more in some fields such as data processing. However, this protocol is still based on the Http protocol. Now let's take a brief look at the specific situation of AMF.

Http-based AMF Protocol

The content processing process is roughly as follows:

1. Obtain the Http Request stream from the client.

2. Stream deserialization (Deserialize) to obtain data that can be recognized by the server program and establish a Response Message

3. Start Debug

4. stream processing (record, license, service) to get the return value

5. serialize the response stream

6. Send an Http Response to the client

The values of the Flash ActionScript data type in the AMF Protocol are:

 
 
  1. Number 0x00;  
  2. Boolean 0x01;  
  3. String 0x02;  
  4. Object 0x03;  
  5. MovieClip 0x04;  
  6. Null 0x05;  
  7. Undefined 0x06;  
  8. Reference 0x07;  
  9. ECMAArray 0x08;  
  10. ObjectEnd 0x09;  
  11. StrictArray 0x0a;  
  12. Date 0x0b;   
  13. LongString 0x0c;   
  14. Unsupported 0x0d;   
  15. Recordset 0x0e;   
  16. XMLObject 0x0f;   
  17. TypedObject(Class) 0x10;  

AMF (Action Message Format) is a binary format data type. The flash data is encoded by AMF over HTTP and sent back to the server, after the remoting adaptor of the server receives the data, it decodes the correct native object and submits it to the correct program for processing 。

In addition to Flash remoting, AMF is also widely used for Local Connection and Flash communication server. Its biggest feature is that it can directly convert flash native objects, such as object, Array, Date, XML, return to the server and automatically translate it into appropriate objects on the server. For example, when flash Array is returned to PHP, it is automatically converted to Associative Array; the biggest benefit of this feature for developers is that they do not need to manually process the complicated work of serialization and deserialization, which not only improves accuracy, but also saves time for development 。
 
Because the AMF protocol is binary format and is highly compressed during encoding, It is very suitable for transmitting a large amount of data. According to the flashorb website testing (mainly for web service and flash remoting ), the higher the data volume, the higher the transmission efficiency of flash remoting, which far exceeds the performance of web services. Therefore, we can also learn the xml, loadVars, loadVariables and other transmission methods using plaine text format are naturally incomparable 。

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.