2009-08-14 Atsushi Enomoto <atsushi@ximian.com>
[mono.git] / mcs / class / System.ServiceModel / System.ServiceModel.Channels / TcpTransportBindingElement.cs
index 6233b801f3281188b39c291286a26d5e862dfadf..07a9d8ff3f723f08bdd4c68d6f8e9bc5a414fe4b 100644 (file)
@@ -87,14 +87,17 @@ namespace System.ServiceModel.Channels
                public override IChannelFactory<TChannel> BuildChannelFactory<TChannel> (
                        BindingContext context)
                {
+                       if (!CanBuildChannelFactory<TChannel> (context))
+                               throw new InvalidOperationException (String.Format ("Not supported channel factory type '{0}'", typeof (TChannel)));
                        return new TcpChannelFactory<TChannel> (this, context);
                }
 
-               [MonoTODO]
                public override IChannelListener<TChannel>
                        BuildChannelListener<TChannel> (
                        BindingContext context)
                {
+                       if (!CanBuildChannelListener<TChannel> (context))
+                               throw new InvalidOperationException (String.Format ("Not supported channel listener type '{0}'", typeof (TChannel)));
                        return new TcpChannelListener<TChannel> (this, context);
                }