private void RealInvokeSink(UPnPService sender, String MethodName, UPnPArgument[] Args, Object ReturnValue, object Tag) { UPnPService S = (UPnPService)InvokeTable[(long)Tag]; ArrayList TempList = new ArrayList(); foreach (UPnPArgument arg in Args) { if (arg.Direction == "out") { TempList.Add(arg); } } lock (CallQueue) { if ((long)CallQueue.Peek() == (long)Tag) { S.DelayedInvokeResponse((long)Tag, ReturnValue, (UPnPArgument[])TempList.ToArray(typeof(UPnPArgument)), null); CallQueue.Dequeue(); bool OK = CallQueue.Count > 0; while (OK) { if (ResponseTable.ContainsKey((long)CallQueue.Peek())) { long key = (long)CallQueue.Dequeue(); object[] G = (object[])ResponseTable[key]; S.DelayedInvokeResponse(key, G[0], (UPnPArgument[])G[1], null); OK = CallQueue.Count > 0; } else { OK = false; } } } else { // Don't Return this Yet ResponseTable[(long)Tag] = new object[2] { ReturnValue, (UPnPArgument[])TempList.ToArray(typeof(UPnPArgument)) }; } } }