users@grizzly.java.net

RE: disableIOEvent read

From: Ben-Yosef Efrat <Efrat.Ben-Yosef_at_comverse.com>
Date: Thu, 5 Feb 2015 15:38:21 +0000

Thanks Alexey

I will try your suggestion of solution, however I still want to understand why my solution does not work.

We disable the IORead on the handleRead() on the same thread invoked by Grizzly (we don't activate any other threads on our own). Why doesn't it block the handleRead() for the next command although we didn't enable the IORead?
Note that both disable/enable and the commands are applied on the same connection.

Thanks
Efrat

From: Oleksiy Stashok [mailto:oleksiy.stashok_at_oracle.com]
Sent: Wednesday, February 04, 2015 8:12 PM
To: users_at_grizzly.java.net
Subject: Re: disableIOEvent read

Hi,

as I understand you run "command" in the separate thread, not in the one FilterChain was executed, is it correct?
Normally there's no need to deal directly with disableIOEvent/enableIOEvent, in 99% of cases you can control that with FilterChain NextAction commands returned from handleXXX methods.

Take a look at this sample:
https://github.com/GrizzlyNIO/grizzly-mirror/blob/2.3.x/samples/framework-samples/src/main/java/org/glassfish/grizzly/samples/echo/EchoFilterAsync.java<http://cp.mcafee.com/d/2DRPow82gsrhojpKepvvjdTdFEITjphhjudFEITjphvjudFEITphu7fcCQrLfTpvKqem3vKNSv4fwnblFXEanc_6DYKrnc_6DYKrtKyUCwM_R-vvsuhWZOWqpEVpV6XOqqfbnjIyyHtd7BgY-F6lK1FJ4SyrLOabUVUQsI3ChNKVIDeqR4IMzapdIxO-1acxgkfb0Md364oO51gYInlB6doUgfGgNfCu3YE43_FzItlYNm9kLg87_jahJyKOxwzFDs00UhfSB7pk9Uhz8k53OSk21_QPX4WUdm9R5V7P-8xgJ2T2eCtdJQ-d2Zj4fy2ycp2wEumUhQPL0QSyOC--r1vF6y12ld87-6xwqc_2pEwz-E6QSjqCOOiSrO8QRP>

Pls. let me know if you have more questions.

WBR,
Alexey.
On 04.02.15 06:42, Ben-Yosef Efrat wrote:
Hello

I want to simulate a synchronic behavior so when client issues two commands at once, when the first command is still executing. Flow is:



1. Client issues command

2. On handleRead() I perform, connection. disableIOEvent(IOEvent.READ)

3. Command is executing (sleeps)

4. Client issues another command - I would expect that the handleRead() will not be called until connection. enableIOEvent(IOEvent.READ) is called. However, the handleRead() is called anyway.


Am I missing something?
Thanks
Efrat
________________________________
"This e-mail message may contain confidential, commercial or privileged information that constitutes proprietary information of Comverse Inc. or its subsidiaries. If you are not the intended recipient of this message, you are hereby notified that any review, use or distribution of this information is absolutely prohibited and we request that you delete all copies and contact us by e-mailing to: security_at_comverse.com<mailto:security_at_comverse.com>. Thank You."

________________________________
"This e-mail message may contain confidential, commercial or privileged information that constitutes proprietary information of Comverse Inc. or its subsidiaries. If you are not the intended recipient of this message, you are hereby notified that any review, use or distribution of this information is absolutely prohibited and we request that you delete all copies and contact us by e-mailing to: security_at_comverse.com. Thank You."