Examples of GameDownBuffer


Examples of com.github.xgameenginee.buffer.GameDownBuffer

    public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) {
        transferredBytes.addAndGet(((ChannelBuffer) e.getMessage()).readableBytes());
        if (value.get() % 10000 == 0) {
            logger.info("send bytes " + transferredBytes.get());
        }
        GameDownBuffer msg = GameDownBuffer.allocat(20, // game type
                104); // game data size
        msg.putInt(value.incrementAndGet()); // value
        for (int i = 0; i < 100; i++) {
            msg.put((byte) i);
        }
        e.getChannel().write(msg.getChannelBuffer());
    }
View Full Code Here

Examples of com.github.xgameenginee.buffer.GameDownBuffer

        if (number != (Integer) connection.getAttachment()) {
            System.out.println("error in number " + number + ":" + (Integer) connection.getAttachment());
        }
        connection.setAttachment(number + 1);

        GameDownBuffer writeBuffer = GameDownBuffer.allocat(20, 1000);
        writeBuffer.putInt(number + 1);
        writeBuffer.put(new byte[996]);
        connection.sendGameDownBuffer(writeBuffer);
        if (connection.isKilled())
            System.out.println("Number = " + number);
        if (number >= 20000) {
            connection.kill();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.