Err.. new to Mina, and not communicating very clearly. :-x

After playing with org.apache.mina.example.httpserver.codec.Server a
bit more in the debugger, I see how to write a non-blocking response
by first writing it to a ByteBuffer and then passing that ByteBuffer
into the IoSession's write method.  The IoSession (a SocketSessionImpl
instance, in this case) takes care of registering the interest-op on
the nio Selector, and calling non-blocking writes on the socket using
the contained nio.ByteBuffer.

Still, I don't understand how to write to the socket in non blocking
manner w/o first writing it all to a ByteBuffer. For example, how to
write the first 10**7 digits of Pi without first righting those digits
into a ByteBuffer? OK, that's a contrived example of dynamically
generated content, but you see my issue, I hope :)

Thanks in advance
-Babak


On Tue, Mar 24, 2009 at 11:07 AM, Babak Farhang <[email protected]> wrote:
> Hi,
>
> I was hoping to find an example of a non-blocking I/O app using Mina
> and TCP transport.  Looked at
> org.apache.mina.example.httpserver.codec.Server but that doesn't seem
> to be non-blocking either.  Any pointers please?
>
> Regards,
> -Babak
>

Reply via email to