示例#1
0
        // Callback from "libICE" to process a message.
        private void ProcessMessage
            (IntPtr iceConn, IntPtr clientData, Xlib.Xint opcode,
            Xlib.Xulong length, XBool swap,
            ref IceReplyWaitInfo replyWait, ref XBool replyReadyRet)
        {
            bool haveReply;

            if (messageTransaction)
            {
                throw new XInvalidOperationException("Attempt to process message in the middle of sending another one");                         // I always wondered, what will happen if we throw exception from callback? :)
            }

            this.messageTransaction = true;
            this.messageLength      = (int)length;

            // Process the message.
            try
            {
                replyWait     = replyWait;
                haveReply     = true;
                replyReadyRet = ProcessMessage((int)opcode, replyWait.reply) ? XBool.True:XBool.False;                         // We omit `swap' here, can one need it? Even theoretrically?..
            }
            catch (NullReferenceException)
            {
                haveReply     = false;
                replyReadyRet = ProcessMessage((int)opcode) ? XBool.True:XBool.False;
            }

            this.messageTransaction = false;
        }
示例#2
0
 extern public static void _IceWrite
     (IceConn *iceConn, Xlib.Xulong nbytes, byte[] ptr);
示例#3
0
 extern public static XStatus _IceRead
     (IceConn *iceConn, Xlib.Xulong nbytes, byte[] ptr);
示例#4
0
 extern public static void _IceReadSkip
     (IceConn *iceConn, Xlib.Xulong nbytes);
示例#5
0
 extern public static IntPtr IceAllocScratch
     (IceConn *iceConn, Xlib.Xulong size);