Use PHP to simulate RTMP client sending AMF message (Barrage launcher)
Use PHP to simulate RTMP client sending AMF message (Barrage launcher)
August 25, 2010
With the advent of Adobe's Open source of rtmp (real-time Messaging Protocol), various third-party flash multimedia servers have sprung up, renowned for their Red5.
However, the client program is rare, the reason is obvious: Flash plug-ins widely.
Th
The data set forth in the AMF protocol is used in ActionScript for HTTP transmission, so that Flex and Server can communicate in good condition. However, many people do not know much about this. Next we will analyze the data.
The AMF protocol is short for the Action Message Format protocol. The AMF protocol is a proprietary protocol of Adobe. It is mainly used fo
AMF (abbreviation of Action Message format) is a remoting format in flash and flex.
AMF is a binary format based loosely on the Simple Object Access Protocol (SOAP). It is used primarily to exchange data between an Adobe Flash application and a database, using a Remote Procedure Call.Each AMF message contains a body which holds the error or response, which will
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 st
Those who have used AMF should know that this is not only efficient, but also greatly relieves the code coupling between the server and the client. Today, I happened to find a node. js-based AMF implementation on github, so I tried some code, hoho ~. The following is an example of communication between Flash and node. js through AMF:
First, define the server clas
ArticleDirectory
Propertydescriptorhelper
AMF is an open-source transmission format developed by Adobe. It is used in multiple places, such as flash and background transmission, and red5 streaming media. The blazeds server in Adobe has provided how to parse the AMFCodeBut because the coupling is a bit high, there are enthusiastic people from the blazeds ServerSource codeI extracted the part of the parsing
AMF data the first byte for the type of this data, the types are:
Number
0x00
Double type
Boolean
0x01
type bool
String
0x02
String type
Object
0x03
Object Type
MovieClip
0x04
Not available in Remoting
Null
0x05
NULL type, NULL
Undefined
0x06
Reference
0x07
Mixedarray
0x08
AMF currently has two versions: amf0 and amf3, which have slightly different definitions of data types. For more information about AMF, see here.
Type
Byte Code
Notes
Number
0 × 00
Boolean
0 × 01
String
0 × 02
Object
0 × 03
Movieclip
0 × 04
Not available in remoting
Null
0 × 05
Undefined
Php encapsulates amf data, sends post analog client requests, and AMF Request Packets. Currently, only the C # version is available. I have never learned C # and want to translate it into a php version, but it hurts a lot. Do you have a class library with similar functions on the Internet? Or code with the same function already exists?
Class AMF_Post_Data {public List
Message ;///
/// Initialize Me
Php encapsulates amf data, sends post analog client requests, AMF requests nbsp; packets. Currently, only C # is available. I have never learned C # and want to translate it into a php version, but it hurts a lot. Do you have a class library with similar functions on the Internet? Or code with the same function already exists? Class nbsp; AMF_Post_Data nbsp; php encapsulate
This is how php sends amf messages. A flex client sends a message to the server. I want to use php to simulate this client to send a request to capture some information. the Content-typeapplicationx-amf sends post data in binary format. Is there any open-source class that can implement this function? How php sends amf messages
This is the case. A flex client sen
To explain how to use the package FluorineFx. AMF3 for AMF data, follow these steps.
FluorineFx. AMF3.ByteArray br = new FluorineFx. AMF3.ByteArray (new MemoryStream (bb); br. position = 0; br. readShort (); // amf version br. readShort (); // Number of headers br. readShort (); // number of bodies br. readUTFBytes (uint) (br. readShort (); // target length and string br. readUTFBytes (uint) (br. readShort
Flex is the front-end interface technology, and the backend and database interaction or large computing still need to rely on Java,. net, PHP, Ruby and other languages. As early as flash 8, Adobe proposed the AMF (Action Message format) technology to convert objects in Java and other languages to the technical specifications of ActionScript objects. AMF transfers compiled objects as binary data, which has m
PHP communicates with Flex through AMF, and I debug the discovery that, as long as there is a date () function, Flex returns an error
a.php
Class Edit_img{ function Gmtime () { $temp = Date (' Z '); return $temp; }
}
?>
This PHP communicates with the flex through AMF, and I debug to find out that as long as there is a date () function, Flex returns with an error.
a.php
}?>This PHP communicates with the flex through AMF, and I debug to find out that as long as there is a date () function, Flex returns with an error. AMF is the 2.1.1 version, I can't think of this problem again and again a.php
}?> Reply to discussion (solution) What is the error message? What is the error message? Flex Tip error message: Channel disconnected before an acknowledgem
The AMF and flex communication issues in PHP
In this example, why does the flex call fail in order, meaning that the difference in PHP is
Require (' d:/empireserver/ecshop/amfphp-2.1.1/amfphp/services/baseattribute.php ');
The order in which the statements appear.
edit_getmaterialtype_sq.php
Class EDIT_GETMATERIALTYPE_SQ{function IsLogin ($isadmin){Require (' d:/empireserver/ecshop/amfphp-2.1.1/amfphp/services/baseattribute.php ');$reLogin = A
Public network of Linux through the FTP command and PHP ftp_connect can not connect, tried 3 machines, can ping, but in the initial connection when the time has been waiting, not to mention the landing FTP server.
However, the local Windows machine can be connected and logged on via the FTP command under the client or CMD.
FTP server firewall is off, FTP port default 21
Reply content:
Public network of Linux through the FTP command and PHP ftp_co
Sophomore writing next semester, now graduated one months, finishingWell, the previous writing is very naïve, only self-understanding, online a lot of, probably the meaning of the next barmysql=========================================http://user.qzone.qq.com/652768664/blog/1347859952To connect MySQL needs to install MySQL, in the MySQL C-disk installation directory has a connection lib, will change the Lib Add reference with the project OK; static
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.