Hi Trustin,

Thanks for the reply;

Implementation of IoSessionOutputstream.java writes asynchronously. If i put
future.join() in the write(ByteBuffer buf) method of
src/main/java/org/apache/mina/handler/support/IoSessionOutputStream.java it
seems to work fine (no session closed errors/exceptions); I am not sure if
this a bug or I could solve this problem any other way.
pointers are welcome.

thanks
veer

On 2/6/07, Trustin Lee <[EMAIL PROTECTED]> wrote:

Hi Veer,

On 2/4/07, Veer <[EMAIL PROTECTED]> wrote:
>
> Hi Folks,
>
> I have question on handling streams (input, output)
>
> if you write to output stream once will session will be closed?


It will be closed when you close the stream, or the remote peer closes the
stream.

I am having this problem; that in separate (I/O) handling  thread,
> I have to write in the output stream in a loop; but as write once in
that
> loop; looks like session get closed;
> some time I get exception (session closed) but 90% time some junk is
> written
> on socket (ethereal sniffer shows) only once.
> Though it loops to write; and 5% time everything works fine; I think
> classic
> thread race conditon problem
>
> Any insights how I can fix this problem. I am using tar ball Mina-1.0.1


I can't give you a good advice on this issue because I don't know what's
going on inside your code.  You could provide us source code that
reproduces
your problem.  JUnit classes are preferred.

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




--
Imagination is more important than knowledge...Albert Einstein

Reply via email to