Package net.sf.cindy

Examples of net.sf.cindy.PacketDecoder


                : SessionType.UDP);
        session.setRemoteAddress(new InetSocketAddress(host, port));

        // set packet encoder and decoder
        session.setPacketEncoder(new BufferEncoder());
        session.setPacketDecoder(new PacketDecoder() {

            public Object decode(Session session, Packet packet)
                    throws Exception {
                Buffer content = packet.getContent();
                return content.getString(Charset.SYSTEM, content.remaining());
View Full Code Here


        Buffer content = packet.getContent();
        int position = content.position();
        int limit = content.limit();

        for (Iterator iter = chain.iterator(); iter.hasNext();) {
            PacketDecoder decoder = (PacketDecoder) iter.next();
            Object obj = decoder.decode(session, packet);
            if (obj != null)
                return obj;

            // not use slice to create new buffer, reduce memory cost
            content.limit(limit);
View Full Code Here

TOP

Related Classes of net.sf.cindy.PacketDecoder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.