Return-Path: Delivered-To: apmail-directory-dev-archive@www.apache.org Received: (qmail 14246 invoked from network); 20 Jul 2005 01:07:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 20 Jul 2005 01:07:12 -0000 Received: (qmail 24624 invoked by uid 500); 20 Jul 2005 01:07:11 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 24443 invoked by uid 500); 20 Jul 2005 01:07:10 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 24430 invoked by uid 99); 20 Jul 2005 01:07:10 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Jul 2005 18:07:10 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=HTML_20_30,HTML_MESSAGE,RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS,URIBL_SBL X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of trustin@gmail.com designates 64.233.184.204 as permitted sender) Received: from [64.233.184.204] (HELO wproxy.gmail.com) (64.233.184.204) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Jul 2005 18:07:06 -0700 Received: by wproxy.gmail.com with SMTP id 71so1310685wri for ; Tue, 19 Jul 2005 18:07:08 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:references; b=RfZmIx7q+/oEHMnQxiQClXTRbznjxvkstKh6yFCWkEDim+eUHxviNa9lDdzO7Lo6GjsKPd6iVGw4EEPtTbD31AkhSVX2Rrh2AYE6V4j+MC0EcSzuGhw5pc2Rvbnov8JN3X6OHPhf3LbTAyY7CBirhigwImtV2nLfcAiZpKAGrNI= Received: by 10.54.50.62 with SMTP id x62mr944436wrx; Tue, 19 Jul 2005 18:05:55 -0700 (PDT) Received: by 10.54.72.4 with HTTP; Tue, 19 Jul 2005 18:05:55 -0700 (PDT) Message-ID: <768dcb2e0507191805290c1b8f@mail.gmail.com> Date: Wed, 20 Jul 2005 10:05:55 +0900 From: Trustin Lee Reply-To: Trustin Lee To: Eriksson Magnus Subject: Re: Mina forum or support Wiki? StreamBased, Multiplexed protocol with Mina? Cc: Apache Directory Developers List In-Reply-To: <948230C0871EA248AB4556FA9E0F6C44CD5776@SESOEXMB01.scania.se> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_6901_21015597.1121821555826" References: <948230C0871EA248AB4556FA9E0F6C44CD5776@SESOEXMB01.scania.se> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_6901_21015597.1121821555826 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi Eriksson, 2005/7/19, Eriksson Magnus : >=20 > 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?=20 StreamIoHandler is usually used for streamed protocols such as HTTP and=20 SMTP. It works more effective than normal Input/OutputStream because all I/= O=20 operations are asynchronous, but Using IoHandler or ProtocolHandler directl= y=20 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= ,=20 I recommend you to modify SumUp example. Otherwise, you could reuse reverse= r=20 example. You could add some extra encoding/decoding operation to=20 TextLineEncoder and TextLineDecoder that translates strings into command=20 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= =20 method in the next release. Thread pools are provided by IoThreadPoolFilter= =20 and ProtocolThreadPoolFilter, so the getter method will be added there.=20 SimpleServiceRegistry is just a wrapper that wraps IoAcceptors and=20 ThreadPoolFilters, so you'll have to get an appropriate IoAcceptor it=20 manages, and call getFilterChain to access the filters registered by=20 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 --=20 what we call human nature is actually human habit -- http://gleamynode.net/ ------=_Part_6901_21015597.1121821555826 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi Eriksson,

2005/7/19, Eriksson Ma= gnus <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 & techni= cal info...
I am not used to navigating the Apache site so maybe it is h= iding 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 lo= oking 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
multiple= xed... 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) th= at 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<= br>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 rec= eived 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 matt= er 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/ ------=_Part_6901_21015597.1121821555826--