[Red5] AMF Format visible
Dominick Accattato
daccattato at gmail.com
Tue Sep 27 10:06:05 PDT 2005
I just wanted to display for those who aren't on the Server Side Team what
were seeing. Thanks to Luke for the deserializer class, we can now seperate
these amf packets out into their native form. For instance with the call
// CLIENT
// start of actionscript code
var nc:Netconnection = new Netconnection();
nc.connect("rtmp://localhost:1935/myApp");
// end of actionscript code
// SERVER
** note - keep in mind that this is after the handshake
we see that we get three AMF Datatypes from this call. The first AMF packet
seems to hold all the initial information related to the calling swf
[java] - Datatype: String
[java] - Datatype: Number
[java] - Datatype: Object
that last datatype which is an Object can be recursively called to unhide
all of its contents using this code provided by Luke:
protected Map readMap(Input in){
log.debug("read map");
Map map = new HashMap();
in.storeReference(map);
while(in.hasMoreProperties()){
String name = in.readPropertyName();
log.debug("property: "+name);
Object property = deserialize(in);
log.debug("val: "+property);
//log.debug("val: "+property.getClass().getName());
map.put(name,property);
if(in.hasMoreProperties())
in.skipPropertySeparator();
}
in.skipEndObject();
return map;
}
What we get back is very interesting. Here is the output of that method all.
// start output
Params: {swfUrl=
file:///C|/Documents%20and%20Settings/daccattato/minaTest2/Red5/tests/TestConnect.swf,
fpad=false, audioCodecs=615, flashVer=WIN 8,0,22,0, pageUrl=null, app=myApp,
videoCodecs=76, tcUrl=rtmp://localhost:1935/myApp}
// end output
notice that there are properties that there are string properties in there.
Well the pageUrl is empty cause i called forom within the Flash IDE not from
within the browser.
The app property holds which channel you want to be part of. We will have to
eventually section off sessions determined by this property i believe.
I'm not sure what fpad means? Luke anything?
Luke these were just observations. Did I explain this well or am I missing
anything.
Anyway from this point we could call functions that save the amf packets or
even pass in objects that determine who these packets go to.
Were really moving along. Thanks Luke for all your contributions thus far.
Keep up the good work. Hopefully I'll be able to chime in sometime with some
code.
cheers!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/red5_osflash.org/attachments/20050927/8b576188/attachment.htm
More information about the Red5
mailing list