IoSession session = ...;
WriteFuture future = session.write(...);
// Wait until the message is completely written out to the O/S buffer.
future.join();
I was looking at this code and I got an idea.
As we want mina to be as non blocking as possible may be instead of
having the thread waiting it
I think I may have figured this out, the javadocs are a little
confusing. In WriteFuture the javadocs say:
IoSession session = ...;
WriteFuture future = session.write(...);
// Wait until the message is completely written out to the O/S buffer.
future.join();
I thought the Wait until the
when I look at the FTP traffic, it appears as though the responses
from my FTP Server do no match up with what the client is sending.
When MINA sends data to a client using IoSession.write(), does that
data get sent immediately, or is it queued in some fashion?
Thank you.
On 9/18/06, Vinod
There is definitely a queue, as the IoSession.write(...) method is
asynchronous. Quoth the javadoc,
http://directory.apache.org/subprojects/mina/apidocs/org/apache/mina/common/IoSession.html#write(java.lang.Object)
As you can see from that link, you may wait for the message to be
written by
thanks. RTFM strikes again!! :)
On 9/19/06, Greg Duffy [EMAIL PROTECTED] wrote:
There is definitely a queue, as the IoSession.write(...) method is
asynchronous. Quoth the javadoc,
Instead of blocking on the WriteFuture you may want to implement
IoHandler.messageSent(). For every call to session.write() there will be
a matching call to messageSent() once the message you wrote has been
sent. This avoids blocking the current thread and should make things
more scalable.
On 9/19/06, Niklas Therning [EMAIL PROTECTED] wrote:
Instead of blocking on the WriteFuture you may want to implement
IoHandler.messageSent(). For every call to session.write() there will be
a matching call to messageSent() once the message you wrote has been
sent. This avoids blocking the
True! :)
One thing though: if I use a listener like you suggest I think it will
be called from within the SocketIoProcessor's worker thread, right? If
that's the case it's very important not to do any heavy processing in
such a callback otherwise that SocketIoProcessor would be completely
I am working on a FTP server using MINA, and it appears that the
responses that the FTP server are sending back to the client are
asynchronous. Based on my understanding of the protocol, the
responses need to be synchronous. So the client sends a command, and
the server sends a response.
Is
On 9/19/06, Mark [EMAIL PROTECTED] wrote:
I am working on a FTP server using MINA, and it appears that the
responses that the FTP server are sending back to the client are
asynchronous. Based on my understanding of the protocol, the
responses need to be synchronous. So the client sends a
10 matches
Mail list logo