// 2002 (C) Copyright, Ximian, Inc.
//
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
using System.Collections;
using System.Reflection;
using System.Runtime.Remoting;
}
// Not found. Try now creation delayed channels
+ RemotingConfiguration.LoadDefaultDelayedChannels ();
foreach (IChannelSender sender in delayedClientChannels)
{
IMessageSink sink = CreateClientChannelSinkChain (sender, url, channelDataArray, out objectUri);
get {
lock (registeredChannels.SyncRoot)
{
- IChannel[] channels = new IChannel[registeredChannels.Count];
-
- for (int i = 0; i < registeredChannels.Count; i++)
- channels[i] = (IChannel) registeredChannels[i];
-
- return channels;
+ ArrayList list = new ArrayList ();
+
+ for (int i = 0; i < registeredChannels.Count; i++) {
+ IChannel ch = (IChannel) registeredChannels[i];
+ if (ch is CrossAppDomainChannel) continue;
+ list.Add (ch);
+ }
+
+ return (IChannel[]) list.ToArray (typeof(IChannel));
}
}
}
{
IChannel regc = (IChannel) registeredChannels[n];
- if (regc.ChannelName == chnl.ChannelName)
+ if (regc.ChannelName == chnl.ChannelName && chnl.ChannelName != "")
throw new RemotingException ("Channel " + regc.ChannelName + " already registered");
if (regc.ChannelPriority < chnl.ChannelPriority && pos==-1)
lock (registeredChannels.SyncRoot)
{
- if (!registeredChannels.Contains ((object) chnl))
- throw new RemotingException ();
-
- registeredChannels.Remove ((object) chnl);
+ for (int n=0; n<registeredChannels.Count; n++)
+ {
+ if (registeredChannels [n] == (object)chnl) {
+ registeredChannels.RemoveAt (n);
+ IChannelReceiver chnlReceiver = chnl as IChannelReceiver;
+ if(chnlReceiver != null)
+ chnlReceiver.StopListening(null);
+ return;
+ }
+ }
+
+ throw new RemotingException ("Channel not registered");
- IChannelReceiver chnlReceiver = chnl as IChannelReceiver;
- if(chnlReceiver != null)
- chnlReceiver.StopListening(null);
}
}
}
}
- public class ExceptionFilterSink: IMessageSink
+ internal class ExceptionFilterSink: IMessageSink
{
IMessageSink _next;
IMessage _call;