Hi Kevin, On 4/18/07, Kevin Williams <[EMAIL PROTECTED]> wrote:
I'm not sure if "long session" is the right term. What I want to do is use a Mina SocketConnector to connect to a service, send a bunch of messages back and forth, then close the connection. I'm thinking in sort of a top-down mode rather than bottom-up. Perhaps some pseudo-code will help explain.IoSession session = new SocketConnector().connect( new InetSocketAddress( 999 ), new MyHandler() ); for( int i = 0; i < 10000; i++ ) { session.write( "hello world" ); // read back result // verify result } session.close(); I understand how the IoHandler sends and receives messages, but I can't figure out how to drive that multiple times over one session. Clear as mud? :)
MyHandler (your IoHandler implementation) will be notified when a result message is received. There's no way to receive a message outside of an IoHandler for now. It's a good feature to have, so we are considering adding a related feature as an extension soon in 2.0. If you are a brave guy, you could try the latest revision in our source code repository, or back-port small part of it. It has a feature that makes it easy to implement a request-response protocol. http://issues.apache.org/jira/browse/DIRMINA-92#action_12488311 HTH, Trustin -- what we call human nature is actually human habit -- http://gleamynode.net/ -- PGP Key ID: 0x0255ECA6
