[Red5] Decoding packets :)

Luke Hubbard (luke@codegent.com) king.selassie at gmail.com
Mon Sep 26 10:42:08 PDT 2005


So.. I spent quite a bit of the time over the weekend, working on putting in
place remoting protocol handlers.
The idea being so I can test the amf code with a real life client. Sounds
simple.. but I had to do all the service invoker stuff too.
Anyway I got it remoting going but its not finished.
Then I though heck remoting seems to be working lets try it out on that RTMP
packet.
30 mins later...

public void onFunctionCallPacket(Packet packet){
Deserializer deserializer = new Deserializer();
Input input = new Input(packet.getData());
String action = (String) deserializer.deserialize(input);
Number number = (Number) deserializer.deserialize(input);
Map params = (Map) deserializer.deserialize(input);
log.debug("Action:" + action);
log.debug("Number: "+number.toString());
log.debug("Params: "+params);
}


- 02 00 07 63 6F 6E 6E 65 63 74 00 3F F0 00 00 00 00 00 00 03
00 03 61 70 70 02 00 09 6C 6F 63 61 6C 68 6F 73 74 00 08 66
6C 61 73 68 56 65 72 02 00 0C 4D 41 43 20 37 2C 30 2C 31 39
2C 30 00 06 73 77 66 55 72 6C 02 00 30 66 69 6C 65 3A 2F 2F
2F 54 49 47 45 52 2F 55 73 65 72 73 2F 6C 75 6B 65 2F 44 65
73 6B 74 6F 70 2F 74 65 73 74 25 35 46 72 74 6D 70 2E 73 77
66 00 05 74 63 55 72 6C 02 00 0F 72 74 6D 70 3A 2F 6C 6F 63
61 6C 68 6F 73 74 00 00 09

- Action:connect
- Number: 1
- Params: {swfUrl=file:///TIGER/Users/luke/Desktop/test%5Frtmp.swf,
flashVer=MAC 7,0,19,0, app=localhost, tcUrl=rtmp:/localhost}

All it took was 3 calls to deserialize.

I need to tidy things up in terms of logging and structure a bit before
checking in.
But just wanted to say.. YAY!!!.

-- Luke
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/red5_osflash.org/attachments/20050927/96a2045f/attachment-0001.htm


More information about the Red5 mailing list