Le 12/07/2017 à 20:00, Martin Asenov a écrit : > When creating my Mina Server, I specify this: > > this.acceptor = new NioSocketAcceptor(); > > this.acceptor.getFilterChain().addLast("logger", new LoggingFilter()); > this.acceptor.getFilterChain().addLast("webSocketCodec", new > ProtocolCodecFilter(new WebSocketCodecFactory())); > this.acceptor.getFilterChain().addLast("binaryCodec", new > ProtocolCodecFilter(new DefaultCodecFactory())); > > The webSocketCodec is one that handles WebSocket handshake stuff. The > binaryCodec is the one that parses custom binary protocol messages. > > In this setup, I expect the following: > > client sends data -> webSocketCodec.encode -> binaryCodec.encode > server writes data -> binaryCodec.encode -> webSocketCodec.encode > > Unfortunately, only the first step of each flow is called. What am I doing > wrong? Can't I use to Protocol Codec Filters after each other?
You can, but you have to add the codecs in the rigth order : on the server side, the binary codec has to be stacked *before* the websocketcodec.O the client, it's the opposite. -- Emmanuel Lecharny Symas.com directory.apache.org