I want to build a Mina server (latest 1.x) for a Flash (Actionscript 3, normal 
socket, not XMLsocket) Client.
I started with the Chat example server. The login works, but after that, the 
client fails to send data that Mina would understand. Nothing arrives in 
messageReceived. I already read the threads that are found when one searches 
for "Flash" but it didn't help.

There's the hint that patching the TextLineCodecFactory with \0-terminated 
lines would help. I built the custom constructor and changed that part in the 
Main class of the example (chain.addLast("codec"...)). What else  do I have to 
do, for this having an effect? Are session.writes and socket reads changed 
automatically then? The extended class looks like this:

public class FlashTextLineCodecFactory extends TextLineCodecFactory {
    private final TextLineEncoder encoder;

    private final TextLineDecoder decoder;
        
        public FlashTextLineCodecFactory(Charset charset, String 
encoderDelimStr, String decoderDelimStr) { 
        encoder = new TextLineEncoder(charset, new 
LineDelimiter(encoderDelimStr)); 
        decoder = new TextLineDecoder(charset, new 
LineDelimiter(decoderDelimStr)); 
        }
}

This extension didn't change anything.

The strange thing is, that the Login works. The server can read the LOGIN 
command from the client and the client can read the LOGIN OK from the server.

With the Java Swing chat client everything works perfectly.

Thanks for your support in advance, I'm in a hurry a bit... ;)

Reply via email to