if it is a bug?

View: New views
1 Messages — Rating Filter:   Alert me  

if it is a bug?

by zswallow :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I use mina to recv media data(TCP/IP) and immediately send it out.
I set 2 NioProcessor, one is for recving data, the other is for sending the recved data.
My recv NioProcessor works well. the "select" function will be wakeup more than 25 times per second. But there is sth wrong with my send NioProcessor. Sometimes it will keep sleep for 1 second, although there is lots of data waiting to be sent out.
 
I found the reason is that, there is something wrong in thread synchronization.
 
I used mina-2.0.0-RC1.
I changed the code, and everything works well.
1   In AbstractorPollingIoProcessor.java : private void flush(long currentTime) function
    I remove "if(flushedAll && ....)
                   scheduleFlush(session);
             "
2   In AbstractorPollingIoProcessor.java: public final void flush(T session) function
    I changed "if(scheduleFlush(session) && needsWakeup)"
           to "if(needsWakeup && scheduleFlush(session))"
 
if it is a bug?