Hi Niklas,
indeed it seems, that there are better solutions :)
What I want to do is to implement a send queue for each session. This
send queue should hold several (more than once) objects already sent or
awaiting to send to a specific client.
Each of the objects can / must be send more than once because it can
happen, that while the transaction (GPRS) data get's lost. After a
specified amount of retries the object must be dropped and the sender
must be informed, that there was a problem.
On the other side the objects / commands should be removed from the
queue, when the server get's a response from the client dedicated to a
specific command (mapped over id's).
Ok, I can add a queue to a session over setAttribute. I can use
IoSession.write(Object) to forward a specific command to the client. I
can use an encoder and / or messageSent(IoSession, Object) to put the
command to the "attributed" queue and messageReceived to remove it from
there.
Seem's that it is ... WDYT?
Best Regards
Michael
Niklas Therning schrieb:
Michael Bauroth wrote:
Hi,
I want to implement some additional behaviour in the implementation of
my TCP sessions. So I need to use my own IoSession implementation I
guess. Could somebody give me please some hints how to do this (which
classes must be changed in this context, best practice)?
What is it you would like to do? Please let us know the problem your
trying to solve. AFAIK there's no way to change to IoSession
implementation being used. But there may be better ways to solve your
particular problem.