0 Replies Latest reply: Mar 29, 2009 6:46 PM by sneakyimp RSS

    AMF3 references - do they reset for each serialized object?

    sneakyimp Community Member
      I have been writing some PHP code to handle AMF3 serialization and deserialization so that I can pass objects back and forth over a socket. In trying to implement the AMF3 specification, I'm having a bit of trouble with the concept of references. The OSFlash site has this to say:
      References are more prominent in AMF3 than in AMF0, and one should have two or three arrays to keep track of them, one for strings, one for objects and possibly one for class definitions (some combine the second and third array). References are per-body, so the reference arrays should be reset every time a new body is encountered (this can happen if calls are batched or if a /onDebugEvents body is sent.

      Does this mean that each time a serialized object is sent with a socket.writeObject(someObj) call that I need to reset these references and start from scratch? That would make A LOT of sense because otherwise, these arrays to track objects would grow QUITE large over time.