directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Trustin Lee <trus...@gmail.com>
Subject Re: Buffer full and session.write()
Date Thu, 09 Jun 2005 00:49:52 GMT
Hello,

2005/6/8, Horia Muntean <horia.muntean@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/

Mime
View raw message