You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Horia Muntean <ho...@gmail.com> on 2005/06/08 13:24:32 UTC

Buffer full and session.write()

Hello,

How does session.write() behave in case of buffer full situations? Is
it still an asynchronous call? Does it throw any exceptions?

There are other questions as well:
1. How does session.getConfig().setWriteTimeout(seconds) come into
play here and what happens if is not set?
2 .What is the diff between sessionCreated and sessionOpened callbacks?

Regards,
Horia

Re: Buffer full and session.write()

Posted by Trustin Lee <tr...@gmail.com>.
Hello,

2005/6/8, Horia Muntean <ho...@gmail.com>: 
> 
> Hello,
> 
> How does session.write() behave in case of buffer full situations? Is
> it still an asynchronous call? Does it throw any exceptions?

 The write request if buffered to MINA internal queue and flushed when 
socket write buffer has any room. It doesn't block or throw any exceptions 
for now. You'll have to set write timeout to prevent OutOfMemoryError.

There are other questions as well:
> 1. How does session.getConfig().setWriteTimeout(seconds) come into
> play here and what happens if is not set?

 If set WriteTimeoutException will be thrown if no data is being written to 
socket for the specified time. If not, nothing will be thrown.

2 .What is the diff between sessionCreated and sessionOpened callbacks?

 sessionCreated is always called inside MINA I/O thread. sessionOpened is 
also called inside MINA I/O therad is you don't use thread pool filter, but 
it is called at pool thread if you do. So you can use sessionCreated to do 
something before actual I/O starts.
 Trustin
-- 
what we call human nature is actually human habit
--
http://gleamynode.net/

Re: Buffer full and session.write()

Posted by Trustin Lee <tr...@gmail.com>.
Please use [mina] prefix btw :)
 Trustin
-- 
what we call human nature is actually human habit
--
http://gleamynode.net/