mina-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sam.Park" <andr...@eumsol.com>
Subject Re: I Wonder Why client connection timeout occurs while the MINA server broadcasts message to connected users.
Date Tue, 12 Apr 2011 10:09:52 GMT


Hi 

I am now aware how I/O processor thread working on MINA framework. It seems
like I/O processor thread 

in threadpool processing new connection event. But I am not sure how exactly
it works.  

Below is my Codes to start Server Process :  

NioSocketAcceptor acceptor = new NioSocketAcceptor();
            
acceptor.getFilterChain().addLast(
     "protocolFilter",
         new ProtocolCodecFilter(
                new myCodecFactory()));
            
acceptor.getFilterChain().addLast("threadPool", new
ExecutorFilter(Executors.newCachedThreadPool()));
            
Regards,




David Latorre wrote:
> 
> 2011/4/12 Sam.Park <android@eumsol.com>:
>>
>>
>> Thanks for reply
>>
>> But I am afraid i already used "ExcutorFilter"  My Code is below :
>>
>> acceptor.getFilterChain().addLast("threadPool", new
>> ExecutorFilter(Executors.newCachedThreadPool()));
>>
>> Any Advice? or helpful link ?
> 
> Although my knowledge of MINA is very limited, I think  that your
> problem is that your server gets blocked while it is writing very
> large messages, right?  This seems to be caused by the I/O processor
> thread and thus an Executor won't help here.  Let's wait for a more
> authoritive answer, but how are you instantiating your
> NioSocketAcceptor?
> 
> 
> 
>>
>>
>>
>> Mavlarn Tuohuti wrote:
>>>
>>> It seems that you used simple thread for IoHandler. You can use a thread
>>> pool as below:
>>> acceptor.getFilterChain().addLast("exceutor", new ExecutorFilter());
>>>
>>> 2011/4/11 박준범 <android@eumsol.com>
>>>
>>>> Hi
>>>>
>>>> I am writing Client/Server network program Using MiNA based on char
>>>> server
>>>> example.
>>>>
>>>> I have a problem to connect server from client . Connection Time out
>>>> occurs
>>>> while MINA Server broadcasts message(about 100kb)  to all
>>>>
>>>> connected Servers. It looks like client's connect operation blocked
>>>> until
>>>> broadcast operation ended. It looks like I/O Connenting handle
>>>>
>>>> thread wait until broadcast ends. I don't know how exactly MINA's
>>>> threading
>>>> model to process I/O action.
>>>>
>>>> Broadcast opration occurred in messageReceived method on IOHandler
>>>> instance.
>>>>
>>>>
>>>> If I increase Client Time-out property more than broadcasting time. No
>>>> Connection Time-out occurs on client
>>>>
>>>> How can i get over this situation?  I'd like for client applications to
>>>> connect to MINA Server concurrently while there are broadcasting
>>>>
>>>> I am using MINA  2.0.2 (NioSocketAcceptor ) and sun JDK 6 on CentOS 5.3
>>>>
>>>> I am not good at english. So Please excuse me for my clumsy english .
>>>>
>>>> Regards,
>>>>
>>>> Park
>>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://old.nabble.com/I-Wonder-Why-client-connection-timeout-occurs-while-the-MINA-server-broadcasts-message-to-connected-users.-tp31369411p31375147.html
>> Sent from the Apache MINA User Forum mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://old.nabble.com/I-Wonder-Why-client-connection-timeout-occurs-while-the-MINA-server-broadcasts-message-to-connected-users.-tp31369411p31377781.html
Sent from the Apache MINA User Forum mailing list archive at Nabble.com.


Mime
View raw message