We don't have standalone test for this.. But I just put together a simple connect/send/receive one - I'm attaching the client html file to use for a simple test (open in ff or chrome).
You can use the Mina TimeServer<http://mina.apache.org/quick-start-guide.html>example to see the filter code in action (with some minor modifications). After you've added the websocket codec code to your project. Just replace 'main' function and messageReceived with the following... *public static void main(String[] args) throws IOException {* * IoAcceptor acceptor = new SocketAcceptor();* * SocketAcceptorConfig cfg = new SocketAcceptorConfig();* * cfg.getFilterChain().addLast("wscodec", new ProtocolCodecFilter(new WebSocketCodecFactory()));* * acceptor.bind( new InetSocketAddress(12346), new TimeServerHandler(), cfg);* * System.out.println("MINA Time server started.");* *}* * * * @Override* * public void messageReceived(IoSession session, Object message) throws Exception {* * IoBuffer buf = (IoBuffer)message;* * System.out.println("received "+buf.array().length+" bytes");* * // send [0 0 0 1] to the client.* * byte[] resp = new byte[4];* * resp[3] = 1;* * * * session.write(WebSocketCodecPacket .buildPacket(IoBuffer.wrap(resp)));* * }* -Dhruv On Tue, Oct 23, 2012 at 6:36 PM, Julien Vermillard <[email protected]>wrote: > Hi, > I took a look at it but it miss tests. > do you have some tests to provide ? > Julien > > On Tue, Oct 23, 2012 at 12:15 PM, Emmanuel Lécharny <[email protected] > >wrote: > > > Le 10/23/12 11:53 AM, Dhruv Chopra a écrit : > > > > Hi Folks, > >> > >> Wanted to check if anyone has had a chance to play with the code we > >> submitted for this filter. > >> In case some information is incomplete, please let me know. > >> > >> Looking forward to your feedback. > >> > > > > Sorry, I was stuck in MINA release (2.0.7) and two other Apache > releases... > > > > Now that 2.0.7 is out, I'm focusing on the site and documentation, but I > > will definitively look at your code ! > > > > Thanks for the polling and sorry for the delay ! > > > > > > -- > > Regards, > > Cordialement, > > Emmanuel Lécharny > > www.iktek.com > > > > >
