Hi the list,

First post here ; I'm new to mina, so please forgive my possibly stupid questions ! I've set up the MinaTimeServer for testing purpose, it's ok, I can use it with telnet. So now, I try to make a little client with mina, but it doesn't work. No objet seems to be written to the session (MinaTimeServer don't receive anything).

Here's the piece of code for client handler :

        public void sessionOpened(IoSession session) {
StringBuffer message = new StringBuffer("ababdfgjhkdgirjkhgfkjhdkyhdgkhrkvjhjdkghkd\r\n");
                session.write(message);
                session.write(message);
        }
        public void messageReceived(IoSession session, Object message) {
                IoBuffer buf = (IoBuffer) message;
                // Print out read buffer content.
                while (buf.hasRemaining()) {
                        System.out.print((char) buf.get());
                }
                System.out.flush();
        }

What's wrong ? How can I send data to the server ? session.write() isn't enought, I must flush or anything like that ?

I'm in localhost, port is ok, iptable is not running.

Thank you !

Ben

Reply via email to