Package xnap.plugin.gift.net.lexer

Examples of xnap.plugin.gift.net.lexer.Command


        try {
            out = socket.getOutputStream();
            in = socket.getInputStream();
            lexer = new StreamLexer(in);

            Command cmd = new Command("attach");
            cmd.addKey("client", "XNap");
            cmd.addKey("version", XNap.VERSION);

            if (user != null) {
                cmd.addKey("profile", user);
            }

            queueCommand(cmd);
            cmd = null;

            while (!exitProcessThread) {
                Thread.sleep(10);

                if (false) { // FIX : !socket.isConnected()

                    break;
                }

                if (in.available() != 0) {
                    cmd = lexer.parse();

                    if (debug) {
                        fireEvent(new DebugEvent(DebugEvent.RECEIVE, cmd));
                    }

                    dispatchCommand(cmd);
                }

                cmd = null;

                if (!outQueue.isEmpty()) {
                    cmd = (Command) outQueue.remove(0);

                    if (debug) {
                        fireEvent(new DebugEvent(DebugEvent.SEND, cmd));
                    }

                    ;
                    out.write(cmd.print().getBytes());
                }

                if (System.currentTimeMillis() > NetworkStatsTimer) {
                    UpdateNetworkStats();
                    NetworkStatsTimer = System.currentTimeMillis() +
View Full Code Here


        }
    }

    public Vector getResults() {
        Vector data = new Vector();
        Command command = null;
        long timeout = -1; //-1 to disable
        try {
            while (((command = lexer.parse()) == null) || (--timeout == 0)) {
            }
View Full Code Here

TOP

Related Classes of xnap.plugin.gift.net.lexer.Command

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.