Hi !

as you know, I was modifying the code to write the messages directly
into the channel instead of pushing it into a queue, and wait for the
SelectorLoop to process it. So far, so good it works well, except that
the messageSent( event is difficult to generate.

Whe we push the message into a queue, what happens is that we feed the
DefaultWriteRequest with the original message (ie before it goes through
the codec filter), and we also add a future into it. This is done
*after* the message has been enqueued. Why ? Because in
AbstractIoSession.processMessageWriting(), we get back the enqueued
message using the lastWriteRequest, which is produced by the
AbstractIoSession.enqueueFinalWriteMessage().

Now, the messageSent() event will be produced by the selectorLoop() when
it process the message to write, pollingit from the queue. At thsi
point, this message has everything needed : the data tow rite, the
original data and teh future.

But when we write the message directly, we don't have the future nor the
original message, yet, but still we have to generate the messageSent
event. This is problematic...

Here, what I suggest, is that the original message is to be passed
through the full chain of filters, so that we can update it in any case.
That would probably mean that the AbstractIoSession.doWriteWithFuture()
create this envelop, feed it with the original message and the future,
and pass this object down the chain.

I don't see any oher way to solve this issue. If any of you have any
better idea, I'm all ears :)

-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com 

Reply via email to