示例#1
0
        internal ComBuffer(Connection.CLICommand cmd, int id)
        {
            int size = 12;

            buf = new byte[size];
            pos = 0;
            putInt(size);
            putInt((int)cmd);
            putInt(id);
        }
示例#2
0
        internal object getObject(Connection.CLICommand cmd, int n)
        {
            if (stmt == null)
            {
                throw new CliError("ObjectSet was aleady closed");
            }
            if (stmt.con == null)
            {
                throw new CliError("Statement was closed");
            }
            ComBuffer buf = new ComBuffer(cmd, stmt.stmtId);

            if (cmd == Connection.CLICommand.cli_cmd_skip)
            {
                buf.putInt(n);
            }
            stmt.con.send(buf);
            buf.reset(4);
            stmt.con.receive(buf, 4);
            int len = buf.getInt();

            if (len == (int)Connection.CLIStatus.cli_not_found)
            {
                return(null);
            }
            else if (len <= 0)
            {
                throw new CliError("Failed to get object");
            }
            buf.reset(len - 4);
            stmt.con.receive(buf, len - 4);
            currOid = buf.getInt();
            if (currOid == 0)
            {
                return(null);
            }
            updated = false;
            return(currObj = stmt.tableDesc.readObject(buf));
        }
示例#3
0
 internal ComBuffer(Connection.CLICommand cmd) : this(cmd, 0)
 {
 }