directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin J. Wells" <>
Subject RE: [mina] c# client
Date Mon, 23 May 2005 08:02:02 GMT
OK. But then how does the message protocol handler know when a message is
done? How do you know you've actually received all the data for a discreet
If the answer is this is not handled by default then how is this typically
done in MINA... how do you hold onto inbound client data until a full
message is ready? For example:
public class ReverseProtocolHandler extends ProtocolHandlerAdapter



    public void messageReceived( ProtocolSession session,

Object message )


        // Reverse reveiced string

        String str = message.toString();

        StringBuffer buf = new StringBuffer( str.length() );

        for( int i = str.length() - 1; i >= 0; i-- )


            buf.append( str.charAt( i ) );


        // and write it back.

        session.write( buf.toString() );


I can test in here whether all the data is available, but if I don't have
the entire message do I have to then implement my own per-client message


From: Trustin Lee [] 
Sent: Monday, 23 May 2005 5:56 PM
To: Apache Directory Developers List
Subject: Re: [mina] c# client

Hi Martin,

2005/5/23, Martin J. Wells <>: 

I'm looking to implement a c# client for a MINA server and was wondering
where I can find some info on the message protocol used. I.e.. how are
message lengths interpreted, is there a magic number header, etc. Can't seem
to locate much in the source... Am I missing something?

MINA itself doesn't implement any protocols.  It simply helps you to
implement your or any others' protocols.  If any protocol specification is
not defined, you'll have to define some first, and then implement the server
to conform to that specifiation, and MINA will help you implementing it.
So.. if you're implementing C# client for a server which is made on top of
MINA, actually it dosn't matter whether the server is implemented using MINA
or any other frameworks. 
what we call human nature is actually human habit

View raw message