Hi Steven,

On 12/28/06, Steven E. Harris <[EMAIL PROTECTED]> wrote:

Does MINA offer some callback equivalent of the ACE library's
ACE_Event_Handler::handle_output() function?ยน In ACE, this function
gets called by a Reactor when a socket is available for writing,
meaning that the outbound TCP buffer is drained sufficiently to take
on new write requests without blocking. This doesn't guarantee that
the data will actually be sent out immediately; rather, it just means
that trying to write to the socket won't block.


No.  But you can check the number of buffered messages by calling
IoSession.getScheduledWrites() or the number of buffered bytes by calling
IoSession.getScheduledWriteBytes(), so you can stop writing additional
messages by checking the value whenever you write a message.  once a message
is flushed out, messageWritten() event is invoked, so you can get notified,
too.

It would be best if there's an automated way to control the flow, but didn't
find what the best way is yet.  You could give us an idea.

HTH,
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP key fingerprints:
* E167 E6AF E73A CBCE EE41  4A29 544D DE48 FE95 4E7E
* B693 628E 6047 4F8F CFA4  455E 1C62 A7DC 0255 ECA6

Reply via email to