powered by Jive Software

Question on rerouting intercepted packets

I have a few questions here.

First, when the Packet Interceptor is fired and a packets state changes from state to state based on the read and processed flags, does the server change anything tot the packets in a normal course of action, or are these flags to let the server know the sate of the packet?

Second, if the server is making changes to a packet based on its state, and I am grabbing the packet after it is processed is there a way to deny the packet at that point? I have tried touse the PacketRejectException but the packet still went thru. I thought that if the Exception is thrown after processing that no packet would be sent and no error message would be sent.

The whole purpose here is to send the packets to third party software for processing without the packet being forwarded to the clients or another server. The third party software would be responsible for redirecting the packet back to the appropriate server for delivery.

Thanks in advance,


You might want to write your own class extending PacketRejectionException which handles sending packets to a third party.

The documentation for PacketInterceptor and PacketRejectionException state that a PacketRejectionException can only be thrown before processed==true.

I’'m having a similar issue in which throwing a PacketRejectionException is not resulting in a message returned to sender, as the docs say should happen.

As jdouglas discovered, packets must be rejected before processed=true. If you just want to redirect packets, I’'d think using Packet.setTo in your interceptor (again while processed=false) would do the trick.

That seems kind of hackish to me. I thought the point of a PacketRejectedException was to represent a situation in which something bad happened with a packet, and you want the packet to be sent right back to the sender.

I just can’‘t figure out why this isn’'t happening as specified.

I likely haven’‘t looked at PacketRejectedException in as much detail as you have jdouglas, so I’‘m not sure how well it works, but my point here was that ndouglas probably doesn’'t need to use PRE at all. For simple redirection, just using setTo on the original packet ought to work.