Exemplo n.º 1
0
        private void ProcessOutProtoBufItem(Hashtable item)
        {
            object obj = item["callback"];
            WriteProtoBufBinaryDataDelegate writeBinaryDataDelegate = obj as WriteProtoBufBinaryDataDelegate;

            if (writeBinaryDataDelegate != null)
            {
                ByteArray             binData = item["data"] as ByteArray;
                ProtoBufPackageHeader header  = item["header"] as ProtoBufPackageHeader;
                writeBinaryDataDelegate(header, binData);
            }
        }
Exemplo n.º 2
0
        public void EnqueueSend(WriteProtoBufBinaryDataDelegate callback, ProtoBufPackageHeader header, ByteArray data)
        {
            Hashtable hashtable = new Hashtable();

            hashtable["callback"] = callback;
            hashtable["header"]   = header;
            hashtable["data"]     = data;
            object obj = this.outQueueLocker;

            Monitor.Enter(obj);
            try
            {
                this.outThreadQueue.Enqueue(hashtable);
                this.outHasQueuedItems = true;
            }
            finally
            {
                Monitor.Exit(obj);
            }
        }