Le 6/18/12 7:57 AM, ನಾಗೇಶ್ ಸುಬ್ರಹ್ಮಣ್ಯ (Nagesh S) a écrit :
Hi,
So the thing is that there is no read if the client just connect and does
not send anything before the heartbeat.
But, the connect is happening once the client has sent a connect message
(containing, for example, id and password). This message is handled in a
handler. Isn't this connect counted as a read after the session is created
(i.e. the server is bound as acceptor.bind(portNumber)) ?
acceptor.bind() does nothing but creating a session. The lastReadTime
counter is only modified when a message is received. There is no message
sent by the user when the session is beng created.
Maybe we should initialize it to the time of the session creation ?
You mean, initially, getCreationTime() and getlastReadTime() report the
same. But, as the session progresses, getlastReadTime() is reset
accordingly ?
Yes.
You can probably woraround your problem by checking that the counter is
0 when you first check the heartbeat, then wit for one more heartbeat.
Also note that I'm just checking the code, it would be easier to check
while debugging it to be sure I'm not missing something.
--
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com