Packet state at server

I was wondering if there is documentation on th estate of a packet from when it arrives at a server and it is sent out in regards to the incoming and processed flags. When intercepting packets there seems to be four states where;

1: incoming = true

processed = false

2: incoming = false

processed = false

3: incoming = true

processed = true

4: incoming = false

processed = true

where states 1 and 4 are pretty straight forward; it’'s either coming un processed or going proccessed. I was hoping to get a better understanding of what going on at states 2 and 3. Any help is appreciated.

thanks,

Nate

I appologize, I had mistyped the previous post. The states should be as followed…

1: read = true

processed = false

2: read = false

processed = false

3: read = false

processed = true

4: read = true

processed = true

It is the fourth state that I am confused on, where the packet is set to incoming and has been processed.

thanks in advance,

– Nate

Message was edited by: ndouglas

The incoming flag tells you if the message is received by OF (incoming=true) or sent by OF (incoming=false).

The tell you if OF has already processed the message.

Ie. if your receive an iq roster set packet:

if processed = false then the new roster is not in db just yet

if processed = true then the updated roster is in the db.

The interceptor will be called once before processing and once after.

Hope this helps

the documentation states that the interceptor is called once before and after processing, but my output looks like it is firing four times, twice before and after. If the read flag is set to true when a packet is read by OF and false when it is sent, how come that last state of my packet is read = true and processed = true and not read = false and processed = false? And on another note, when I get read = false and processed = false, does that mean the packet was sent without being processed?

Thanks in advanced,

– Nate

This behaviour is normal:

-OF treats an incoming message from the sender

1 the interceptor is called with incoming = true, processed = false

  • OF handle the packet, and prepare to send it to the receipient

2 interceptor is called with incoming=false processed =false

  • message is actually sent

3 interceptor is call with incoming=false processed = true

  • finally the incoming packet has been sent to the receipient so

4 interceptor is called with incoming=true processed= true

You should decide where you want to intercept the packet.

If for example you want to intercept packet when it is incoming, then you should put this at the begining of your intercept method:

if(incoming!= true && processed!=false)

return;

OK…lets see if I got this. If I want to intercept the packet when it first comes in, I want incoming = true and processed = false? And if I want to intercept a processed packet to reroute it, I would use read = true and procesed = true?

– Nate