directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Trustin Lee <trus...@gmail.com>
Subject Re: Mina forum or support Wiki? StreamBased, Multiplexed protocol with Mina?
Date Wed, 20 Jul 2005 01:05:55 GMT
Hi Eriksson,

2005/7/19, Eriksson Magnus <magnus_p.eriksson@scania.com>:
> 
> I looked for a wiki or news group were one can post questions like this
> one but I only found a "read only" WIKI with project & technical info...
> I am not used to navigating the Apache site so maybe it is hiding there
> somewhere :)


MINA official web site is: http://directory.apache.org/subprojects/network/
I guess we need a forum for MINA. I'll create one soon.

I am looking at ways to implement a stream based, multiplexed protocol
> and read about Mina on the ServerSide. I looked at the documentation and
> found two examples (httpserver and SumUp) that do the two things (async
> & multiplex) BUT NOT AT THE SAME TIME... It seems like you need to write
> a StreamIoHandler to do stream based (extend StreamIoHandler) and
> instead use a ProtocolProvider (that uses Demuxingxx) to do
> multiplexed... Can it be combined somehow???


What is the benefit you get from combining streaming and multiplexing? 
StreamIoHandler is usually used for streamed protocols such as HTTP and 
SMTP. It works more effective than normal Input/OutputStream because all I/O 
operations are asynchronous, but Using IoHandler or ProtocolHandler directly 
is far more effective.

What I want to do is to let each session use an a stream (in each
> direction) that it sends (numbered) commands and receive (numbered)
> replies on. The replies may of course be out of order (some take longer
> to process than others). Is this hard to do with Mina? Any pointers to
> were I can look for more examples or other information that can help me
> on the way?


It is easy to do so. Is the protocol text-based, or binary? If it is binary, 
I recommend you to modify SumUp example. Otherwise, you could reuse reverser 
example. You could add some extra encoding/decoding operation to 
TextLineEncoder and TextLineDecoder that translates strings into command 
object or vice versa.

I would also like to set a fixed number of service threads that process
> the received requests - can this be done? Using what class??


For now you cannot get the number of active threads. I need to add a getter 
method in the next release. Thread pools are provided by IoThreadPoolFilter 
and ProtocolThreadPoolFilter, so the getter method will be added there. 
SimpleServiceRegistry is just a wrapper that wraps IoAcceptors and 
ThreadPoolFilters, so you'll have to get an appropriate IoAcceptor it 
manages, and call getFilterChain to access the filters registered by 
SimpleServiceRegistry.

No matter if it can be used for my protocol or not it seems like you are
> on to something "big2 with this project - I think Mina will be really
> useful! Keep up the good work!!!!


What do you mean by "big2"? :) Thanks!

Trustin
-- 
what we call human nature is actually human habit
--
http://gleamynode.net/

Mime
View raw message