Excellent.  Thanks for the answer.

A follow up question if I may.

Is there a way of tracking what objects are written to the session? For
example.. session.getLastWrittenObject()?


On 2 April 2014 11:19, Emmanuel Lécharny <[email protected]> wrote:

> Le 4/2/14 10:32 AM, Aidan Diffey a écrit :
> > Hello.
> >
> > I am attempting to do the following:
> >
> > 1. Receive a message from a device that informs me that data is available
> > for pulling.
> > 2. Send a message to the deivce (on the incomming connection) to request
> > the data.
> > 3. Receive the data
> > 4. Send a message deleteing the data and requesting more. (The delete
> needs
> > to arrive at the device before the request message does).
> >
> > How can I ensure that the delete request will arrive at the devices
> before
> > the data request?
> If I understand correctly, you want to be sure that your client will
> receive the delete message, and then the request for more data ?
>
> I don't see the problem here. If you send a delete message, it will be
> pushed into the socket before the message that request some more data,
> so you client will *always* receive the delete message *before* the
> sendMore request...
>
> There is no magic here. Ech message pushed using session.write() will be
> sent in the exact same order : session.write() is pushing each of those
> messages into a queue, and this queue will be read sequencially by the
> thread in charge of sending the data to your client.
>
> There is one case where you can have trouble though, this is if you have
> added an ExecutorFilter in your chain, and if you have multiple threads
> writing in the same session (ie, you haven't used the
> orderedThrezadPoolExecutor).
>
> --
> Regards,
> Cordialement,
> Emmanuel Lécharny
> www.iktek.com
>
>

Reply via email to