2010-06-21 Atsushi Enomoto <atsushi@ximian.com>
authorAtsushi Eno <atsushieno@gmail.com>
Mon, 21 Jun 2010 13:56:53 +0000 (13:56 -0000)
committerAtsushi Eno <atsushieno@gmail.com>
Mon, 21 Jun 2010 13:56:53 +0000 (13:56 -0000)
* ChannelDispatcher.cs : raise an error if IChannelListener is
  already opened when it's opening.

svn path=/trunk/mcs/; revision=159267

mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/ChangeLog
mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/ChannelDispatcher.cs

index 827853b255e1a5d4594185ce7a095844cc519e14..0273258353b0a83b2970dde4b95efe959a5516a8 100644 (file)
@@ -1,3 +1,8 @@
+2010-06-21  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * ChannelDispatcher.cs : raise an error if IChannelListener is
+         already opened when it's opening.
+
 2010-06-21  Atsushi Enomoto  <atsushi@ximian.com>
 
        * ServiceThrottle.cs : take ChannelDispatcher to validate setters.
index 13408a504cac00ed526fdd6cede589736315e258..fa7039f0b063de4eb83eb640727a16ce414dabc4 100644 (file)
@@ -346,8 +346,9 @@ namespace System.ServiceModel.Dispatcher
 
                        public void Setup (TimeSpan openTimeout)
                        {
-                               if (owner.Listener.State != CommunicationState.Opened)
-                                       owner.Listener.Open (openTimeout);
+                               if (owner.Listener.State != CommunicationState.Created)
+                                       throw new InvalidOperationException ("Tried to open the channel listener which is bound to ChannelDispatcher, but it is not at Created state");
+                               owner.Listener.Open (openTimeout);
 
                                // It is tested at Open(), but strangely it is not instantiated at this point.
                                foreach (var ed in owner.Endpoints)