Author: atsushi
Date: 2008-02-20 01:38:53 -0500 (Wed, 20 Feb 2008)
New Revision: 96219

Added:
   
trunk/olive/class/System.ServiceModel/System.ServiceModel.Channels/TcpConnectionPoolSettings.cs
   
trunk/olive/class/System.ServiceModel/Test/System.ServiceModel.Channels/TcpTransportBindingElementTest.cs
Modified:
   trunk/olive/class/System.ServiceModel/System.ServiceModel.Channels/ChangeLog
   
trunk/olive/class/System.ServiceModel/System.ServiceModel.Channels/ConnectionOrientedTransportBindingElement.cs
   
trunk/olive/class/System.ServiceModel/System.ServiceModel.Channels/TcpTransportBindingElement.cs
   trunk/olive/class/System.ServiceModel/System.ServiceModel.dll.sources
   trunk/olive/class/System.ServiceModel/System.ServiceModel/ChangeLog
   trunk/olive/class/System.ServiceModel/System.ServiceModel/EnvelopeVersion.cs
   trunk/olive/class/System.ServiceModel/System.ServiceModel/NetTcpBinding.cs
   trunk/olive/class/System.ServiceModel/System.ServiceModel_test.dll.sources
   
trunk/olive/class/System.ServiceModel/Test/System.ServiceModel.Channels/ChangeLog
   
trunk/olive/class/System.ServiceModel/Test/System.ServiceModel.Channels/EnvelopeVersionTest.cs
Log:
2008-02-20  Atsushi Enomoto  <[EMAIL PROTECTED]>

        * NetTcpBinding.cs : store transport and use it for some properties.
        * EnvelopeVersion.cs : updated destinations to 3.0 SP1.

        * ConnectionOrientedTransportBindingElement.cs, 
          TcpTransportBindingElement.cs : some API updates.
          Initialize default values.
        * TcpConnectionPoolSettings.cs : new file.

        * EnvelopeVersionTest.cs : updated to work with .NET 3.0 SP1.
        * TcpTransportBindingElementTest.cs : new test.



Modified: trunk/olive/class/System.ServiceModel/System.ServiceModel/ChangeLog
===================================================================
--- trunk/olive/class/System.ServiceModel/System.ServiceModel/ChangeLog 
2008-02-20 06:34:06 UTC (rev 96218)
+++ trunk/olive/class/System.ServiceModel/System.ServiceModel/ChangeLog 
2008-02-20 06:38:53 UTC (rev 96219)
@@ -1,3 +1,8 @@
+2008-02-20  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
+       * NetTcpBinding.cs : store transport and use it for some properties.
+       * EnvelopeVersion.cs : updated destinations to 3.0 SP1.
+
 2008-02-17  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
        * OperationContext.cs : implemented OutgoingMessageHeaders and

Modified: 
trunk/olive/class/System.ServiceModel/System.ServiceModel/EnvelopeVersion.cs
===================================================================
--- 
trunk/olive/class/System.ServiceModel/System.ServiceModel/EnvelopeVersion.cs    
    2008-02-20 06:34:06 UTC (rev 96218)
+++ 
trunk/olive/class/System.ServiceModel/System.ServiceModel/EnvelopeVersion.cs    
    2008-02-20 06:38:53 UTC (rev 96219)
@@ -33,6 +33,8 @@
 
        public sealed class EnvelopeVersion
        {
+               const string Soap11NextReceiver = 
"http://schemas.xmlsoap.org/soap/actor/next";;
+               const string Soap12NextReceiver = 
"http://www.w3.org/2003/05/soap-envelope/role/next";;
                internal const string Soap12UltimateReceiver = 
"http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver";;
 
                string name, uri, next_destination;
@@ -40,14 +42,16 @@
 
                static EnvelopeVersion soap11 = new EnvelopeVersion ("Soap11",
                                                                     
"http://schemas.xmlsoap.org/soap/envelope/";,
-                                                                    
"http://schemas.xmlsoap.org/soap/actor/next";,
-                                                                    
String.Empty);
+                                                                    
Soap11NextReceiver,
+                                                                    
String.Empty,
+                                                                    
Soap11NextReceiver);
 
                static EnvelopeVersion soap12 = new EnvelopeVersion ("Soap12",
                                                                     
"http://www.w3.org/2003/05/soap-envelope";,
-                                                                    
"http://www.w3.org/2003/05/soap-envelope/role/next";,
+                                                                    
Soap12NextReceiver,
                                                                     
String.Empty,
-                                                                    
Soap12UltimateReceiver);
+                                                                    
Soap12UltimateReceiver,
+                                                                    
Soap12NextReceiver);
 
                static EnvelopeVersion none = new EnvelopeVersion ("None",
                                                                     
String.Empty,

Modified: 
trunk/olive/class/System.ServiceModel/System.ServiceModel/NetTcpBinding.cs
===================================================================
--- trunk/olive/class/System.ServiceModel/System.ServiceModel/NetTcpBinding.cs  
2008-02-20 06:34:06 UTC (rev 96218)
+++ trunk/olive/class/System.ServiceModel/System.ServiceModel/NetTcpBinding.cs  
2008-02-20 06:38:53 UTC (rev 96219)
@@ -40,19 +40,18 @@
        public class NetTcpBinding : Binding, IBindingRuntimePreferences
        {
                HostNameComparisonMode comparison_mode;
-               int listen_backlog;
                long max_pool_size;
                int max_buf_size;
                int max_conn;
                long max_msg_size;
                OptionalReliableSession reliable_session;
                NetTcpSecurity security;
-               bool port_sharing_enabled;
                XmlDictionaryReaderQuotas reader_quotas;
                EnvelopeVersion soap_version;
                bool transaction_flow;
                TransactionProtocol transaction_protocol;
                TransferMode transfer_mode;
+               TcpTransportBindingElement transport = new 
TcpTransportBindingElement ();
 
                public NetTcpBinding ()
                        : this (SecurityMode.Message)
@@ -76,8 +75,8 @@
                }
 
                public int ListenBacklog {
-                       get { return listen_backlog; }
-                       set { listen_backlog = value; }
+                       get { return transport.ListenBacklog; }
+                       set { transport.ListenBacklog = value; }
                }
 
                public long MaxBufferPoolSize {
@@ -101,8 +100,8 @@
                }
 
                public bool PortSharingEnabled {
-                       get { return port_sharing_enabled; }
-                       set { port_sharing_enabled = value; }
+                       get { return transport.PortSharingEnabled; }
+                       set { transport.PortSharingEnabled = value; }
                }
 
                public OptionalReliableSession ReliableSession {
@@ -161,7 +160,7 @@
 
                BindingElement GetTransport ()
                {
-                       return new TcpTransportBindingElement ();
+                       return transport.Clone ();
                }
 
                // based on WSHttpBinding.CreateMessageSecurity()

Modified: 
trunk/olive/class/System.ServiceModel/System.ServiceModel.Channels/ChangeLog
===================================================================
--- 
trunk/olive/class/System.ServiceModel/System.ServiceModel.Channels/ChangeLog    
    2008-02-20 06:34:06 UTC (rev 96218)
+++ 
trunk/olive/class/System.ServiceModel/System.ServiceModel.Channels/ChangeLog    
    2008-02-20 06:38:53 UTC (rev 96219)
@@ -1,3 +1,10 @@
+2008-02-20  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
+       * ConnectionOrientedTransportBindingElement.cs, 
+         TcpTransportBindingElement.cs : some API updates.
+         Initialize default values.
+       * TcpConnectionPoolSettings.cs : new file.
+
 2008-02-18  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
        * ServiceHostParser.cs, SvcHttpHandlerFactory.cs, SvcHttpHandler.cs:

Modified: 
trunk/olive/class/System.ServiceModel/System.ServiceModel.Channels/ConnectionOrientedTransportBindingElement.cs
===================================================================
--- 
trunk/olive/class/System.ServiceModel/System.ServiceModel.Channels/ConnectionOrientedTransportBindingElement.cs
     2008-02-20 06:34:06 UTC (rev 96218)
+++ 
trunk/olive/class/System.ServiceModel/System.ServiceModel.Channels/ConnectionOrientedTransportBindingElement.cs
     2008-02-20 06:38:53 UTC (rev 96219)
@@ -37,13 +37,12 @@
        public abstract class ConnectionOrientedTransportBindingElement
                : TransportBindingElement
        {
-               int connection_buf_size, max_buf_size,
-                       max_inbound_connections, max_outbound,
-                       max_pending_accepts;
-               string connection_pool_group_name;
-               HostNameComparisonMode host_cmp_mode;
-               TimeSpan idle_timeout, max_output_delay;
-               TransferMode transfer_mode;
+               int connection_buf_size = 0x2000, max_buf_size = 0x10000,
+                       max_pending_conn = 10, max_pending_accepts = 1;
+               HostNameComparisonMode host_cmp_mode = 
HostNameComparisonMode.StrongWildcard;
+               TimeSpan max_output_delay = TimeSpan.FromMilliseconds (200);
+               TimeSpan ch_init_timeout = TimeSpan.FromSeconds (5);
+               TransferMode transfer_mode = TransferMode.Buffered;
 
                internal ConnectionOrientedTransportBindingElement ()
                {
@@ -55,52 +54,38 @@
                {
                        connection_buf_size = other.connection_buf_size;
                        max_buf_size = other.max_buf_size;
-                       max_inbound_connections = other.max_inbound_connections;
-                       max_outbound = other.max_outbound;
+                       max_pending_conn = other.max_pending_conn;
                        max_pending_accepts = other.max_pending_accepts;
-                       connection_pool_group_name =
-                               other.connection_pool_group_name;
                        host_cmp_mode = other.host_cmp_mode;
-                       idle_timeout = other.idle_timeout;
                        max_output_delay = other.max_output_delay;
                        transfer_mode = other.transfer_mode;
                }
 
+               public TimeSpan ChannelInitializationTimeout {
+                       get { return ch_init_timeout; }
+                       set { ch_init_timeout = value; }
+               }
+
                public int ConnectionBufferSize {
                        get { return connection_buf_size; }
                        set { connection_buf_size = value; }
                }
 
-               public string ConnectionPoolGroupName {
-                       get { return connection_pool_group_name; }
-                       set { connection_pool_group_name = value; }
-               }
-
                public HostNameComparisonMode HostNameComparisonMode {
                        get { return host_cmp_mode; }
                        set { host_cmp_mode = value; }
                }
 
-               public TimeSpan IdleTimeout {
-                       get { return idle_timeout; }
-                       set { idle_timeout = value; }
-               }
-
                public int MaxBufferSize {
                        get { return max_buf_size; }
                        set { max_buf_size = value; }
                }
 
-               public int MaxInboundConnections {
-                       get { return max_inbound_connections; }
-                       set { max_inbound_connections = value; }
+               public int MaxPendingConnections {
+                       get { return max_pending_conn; }
+                       set { max_pending_conn = value; }
                }
 
-               public int MaxOutboundConnectionsPerEndpoint {
-                       get { return max_outbound; }
-                       set { max_outbound = value; }
-               }
-
                public TimeSpan MaxOutputDelay {
                        get { return max_output_delay; }
                        set { max_output_delay = value; }
@@ -115,5 +100,19 @@
                        get { return transfer_mode; }
                        set { transfer_mode = value; }
                }
+               
+               [MonoTODO]
+               public override bool CanBuildChannelFactory<TChannel> (
+                       BindingContext context)
+               {
+                       return typeof (TChannel) == typeof 
(IDuplexSessionChannel);
+               }
+
+               [MonoTODO]
+               public override bool CanBuildChannelListener<TChannel> (
+                       BindingContext context)
+               {
+                       return typeof (TChannel) == typeof 
(IDuplexSessionChannel);
+               }
        }
 }

Added: 
trunk/olive/class/System.ServiceModel/System.ServiceModel.Channels/TcpConnectionPoolSettings.cs
===================================================================
--- 
trunk/olive/class/System.ServiceModel/System.ServiceModel.Channels/TcpConnectionPoolSettings.cs
     2008-02-20 06:34:06 UTC (rev 96218)
+++ 
trunk/olive/class/System.ServiceModel/System.ServiceModel.Channels/TcpConnectionPoolSettings.cs
     2008-02-20 06:38:53 UTC (rev 96219)
@@ -0,0 +1,72 @@
+//
+// TcpConnectionPoolSettings.cs
+//
+// Authors:
+//     Atsushi Enomoto <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2008 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;
+using System.Collections.Generic;
+using System.Net;
+using System.ServiceModel.Channels;
+using System.ServiceModel.Description;
+
+namespace System.ServiceModel.Channels
+{
+       public sealed class TcpConnectionPoolSettings
+       {
+               internal TcpConnectionPoolSettings ()
+               {
+               }
+
+               string group_name = "default";
+               TimeSpan idle_timeout = TimeSpan.FromSeconds (120);
+               TimeSpan lease_timeout = TimeSpan.FromSeconds (300);
+               int max_conn = 10;
+
+               [MonoTODO]
+               public string GroupName {
+                       get { return group_name; }
+                       set { group_name = value; }
+               }
+
+               [MonoTODO]
+               public TimeSpan IdleTimeout {
+                       get { return idle_timeout; }
+                       set { idle_timeout = value; }
+               }
+
+               [MonoTODO]
+               public TimeSpan LeaseTimeout {
+                       get { return lease_timeout; }
+                       set { lease_timeout = value; }
+               }
+
+               [MonoTODO]
+               public int MaxOutboundConnectionsPerEndpoint {
+                       get { return max_conn; }
+                       set { max_conn = value; }
+               }
+       }
+}


Property changes on: 
trunk/olive/class/System.ServiceModel/System.ServiceModel.Channels/TcpConnectionPoolSettings.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: 
trunk/olive/class/System.ServiceModel/System.ServiceModel.Channels/TcpTransportBindingElement.cs
===================================================================
--- 
trunk/olive/class/System.ServiceModel/System.ServiceModel.Channels/TcpTransportBindingElement.cs
    2008-02-20 06:34:06 UTC (rev 96218)
+++ 
trunk/olive/class/System.ServiceModel/System.ServiceModel.Channels/TcpTransportBindingElement.cs
    2008-02-20 06:38:53 UTC (rev 96219)
@@ -44,7 +44,9 @@
                int listen_backlog = 10;
                bool port_sharing_enabled = false;
                bool teredo_enabled = false;
-               
+               TcpConnectionPoolSettings connection_pool_settings =
+                       new TcpConnectionPoolSettings ();
+
                public TcpTransportBindingElement ()
                {
                }
@@ -57,7 +59,9 @@
                        port_sharing_enabled = other.port_sharing_enabled;
                }
                
-               //public TcpConnectionPoolSettings ConnectionPoolSettings { 
get; }
+               public TcpConnectionPoolSettings ConnectionPoolSettings {
+                       get { return connection_pool_settings; }
+               }
 
                public int ListenBacklog {
                        get { return listen_backlog; }
@@ -93,33 +97,17 @@
                {
                        return new TcpChannelListener<TChannel> (this, context);
                }
-               
-               [MonoTODO]
-               public override bool CanBuildChannelFactory<TChannel> (
-                       BindingContext context)
-               {
-                       return typeof (TChannel) == typeof 
(IDuplexSessionChannel);
-               }
 
-               [MonoTODO]
-               public override bool CanBuildChannelListener<TChannel> (
-                       BindingContext context)
-               {
-                       return typeof (TChannel) == typeof 
(IDuplexSessionChannel);
-               }
-
                public override BindingElement Clone ()
                {
                        return new TcpTransportBindingElement (this);
                }
 
-               // FIXME: it should not be required but gmcs borks here.
-               /*
                [MonoTODO]
                public override T GetProperty<T> (BindingContext context)
                {
-                       throw new NotImplementedException ();
+                       // FIXME: ... or return ISecurityCapabilities?
+                       return context.GetInnerProperty<T> ();
                }
-               */
        }
 }

Modified: trunk/olive/class/System.ServiceModel/System.ServiceModel.dll.sources
===================================================================
--- trunk/olive/class/System.ServiceModel/System.ServiceModel.dll.sources       
2008-02-20 06:34:06 UTC (rev 96218)
+++ trunk/olive/class/System.ServiceModel/System.ServiceModel.dll.sources       
2008-02-20 06:38:53 UTC (rev 96219)
@@ -128,6 +128,7 @@
 System.Collections.Generic/SynchronizedKeyedCollection.cs
 System.Collections.Generic/SynchronizedReadOnlyCollection.cs
 System.ServiceModel.Activation/AspNetIntegrationRequirementsAttribute.cs
+System.ServiceModel.Activation/IServiceHostFactory.cs
 System.ServiceModel.Activation/ServiceHostFactory.cs
 System.ServiceModel.Activation/ServiceHostFactoryBase.cs
 System.ServiceModel.Channels/AddressHeader.cs
@@ -271,6 +272,7 @@
 System.ServiceModel.Channels/SymmetricSecurityBindingElement.cs
 System.ServiceModel.Channels/TcpChannelFactory.cs
 System.ServiceModel.Channels/TcpChannelListener.cs
+System.ServiceModel.Channels/TcpConnectionPoolSettings.cs
 System.ServiceModel.Channels/TcpDuplexSessionChannel.cs
 System.ServiceModel.Channels/TcpTransportBindingElement.cs
 System.ServiceModel.Channels/TextMessageEncoder.cs

Modified: 
trunk/olive/class/System.ServiceModel/System.ServiceModel_test.dll.sources
===================================================================
--- trunk/olive/class/System.ServiceModel/System.ServiceModel_test.dll.sources  
2008-02-20 06:34:06 UTC (rev 96218)
+++ trunk/olive/class/System.ServiceModel/System.ServiceModel_test.dll.sources  
2008-02-20 06:38:53 UTC (rev 96219)
@@ -34,6 +34,7 @@
 System.ServiceModel.Channels/SecurityBindingElementTest.cs
 System.ServiceModel.Channels/SslStreamSecurityBindingElementTest.cs
 System.ServiceModel.Channels/SymmetricSecurityBindingElementTest.cs
+System.ServiceModel.Channels/TcpTransportBindingElementTest.cs
 System.ServiceModel.Channels/TextMessageEncodingBindingElementTest.cs
 System.ServiceModel.Channels/TransactionFlowBindingElementTest.cs
 System.ServiceModel.Configuration/BasicHttpBindingElementTest.cs

Modified: 
trunk/olive/class/System.ServiceModel/Test/System.ServiceModel.Channels/ChangeLog
===================================================================
--- 
trunk/olive/class/System.ServiceModel/Test/System.ServiceModel.Channels/ChangeLog
   2008-02-20 06:34:06 UTC (rev 96218)
+++ 
trunk/olive/class/System.ServiceModel/Test/System.ServiceModel.Channels/ChangeLog
   2008-02-20 06:38:53 UTC (rev 96219)
@@ -1,3 +1,8 @@
+2008-02-20  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
+       * EnvelopeVersionTest.cs : updated to work with .NET 3.0 SP1.
+       * TcpTransportBindingElementTest.cs : new test.
+
 2008-02-15  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
        * HttpTransportBindingElementTest.cs : test for BuildChannelListener()

Modified: 
trunk/olive/class/System.ServiceModel/Test/System.ServiceModel.Channels/EnvelopeVersionTest.cs
===================================================================
--- 
trunk/olive/class/System.ServiceModel/Test/System.ServiceModel.Channels/EnvelopeVersionTest.cs
      2008-02-20 06:34:06 UTC (rev 96218)
+++ 
trunk/olive/class/System.ServiceModel/Test/System.ServiceModel.Channels/EnvelopeVersionTest.cs
      2008-02-20 06:38:53 UTC (rev 96219)
@@ -42,16 +42,19 @@
                [Test]
                public void GetUltimateDestinationActorValuesTest ()
                {
-                       // SOAP 1.1 consists of just (String.Empty)
-                       Assert.AreEqual (1, 
EnvelopeVersion.Soap11.GetUltimateDestinationActorValues ().Length);
-                       Assert.AreEqual (String.Empty, 
EnvelopeVersion.Soap11.GetUltimateDestinationActorValues () [0]);
+                       // SOAP 1.1
+                       Assert.AreEqual (2, 
EnvelopeVersion.Soap11.GetUltimateDestinationActorValues ().Length, "#1");
+                       Assert.AreEqual (String.Empty, 
EnvelopeVersion.Soap11.GetUltimateDestinationActorValues () [0], "#2");
+                       Assert.AreEqual 
("http://schemas.xmlsoap.org/soap/actor/next";, 
EnvelopeVersion.Soap11.GetUltimateDestinationActorValues () [1], "#3");
 
-                       // SOAP 1.2 consists of (String.Empty, special URI) 
-                       Assert.AreEqual (2, 
EnvelopeVersion.Soap12.GetUltimateDestinationActorValues ().Length);
+                       // SOAP 1.2
+                       Assert.AreEqual (3, 
EnvelopeVersion.Soap12.GetUltimateDestinationActorValues ().Length, "#4");
                        Assert.AreEqual (String.Empty,
-                           
EnvelopeVersion.Soap12.GetUltimateDestinationActorValues () [0]);
+                           
EnvelopeVersion.Soap12.GetUltimateDestinationActorValues () [0], "#5");
                        Assert.AreEqual 
("http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver";,
-                           
EnvelopeVersion.Soap12.GetUltimateDestinationActorValues () [1]);
+                                        
EnvelopeVersion.Soap12.GetUltimateDestinationActorValues () [1], "#6");
+                       Assert.AreEqual 
("http://www.w3.org/2003/05/soap-envelope/role/next";,
+                                        
EnvelopeVersion.Soap12.GetUltimateDestinationActorValues () [2], "#7");
                }
 
                [Test]

Added: 
trunk/olive/class/System.ServiceModel/Test/System.ServiceModel.Channels/TcpTransportBindingElementTest.cs
===================================================================
--- 
trunk/olive/class/System.ServiceModel/Test/System.ServiceModel.Channels/TcpTransportBindingElementTest.cs
   2008-02-20 06:34:06 UTC (rev 96218)
+++ 
trunk/olive/class/System.ServiceModel/Test/System.ServiceModel.Channels/TcpTransportBindingElementTest.cs
   2008-02-20 06:38:53 UTC (rev 96219)
@@ -0,0 +1,124 @@
+//
+// TcpTransportBindingElementTest.cs
+//
+// Author:
+//     Atsushi Enomoto <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2008 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;
+using System.Collections.ObjectModel;
+using System.IO;
+using System.Net;
+using System.Net.Security;
+using System.ServiceModel;
+using System.ServiceModel.Channels;
+using System.ServiceModel.Description;
+using System.Threading;
+using System.Xml;
+using NUnit.Framework;
+
+namespace MonoTests.System.ServiceModel.Channels
+{
+       [TestFixture]
+       public class TcpTransportBindingElementTest
+       {
+               static BindingParameterCollection empty_params =
+                       new BindingParameterCollection ();
+
+               [Test]
+               public void DefaultValues ()
+               {
+                       TcpTransportBindingElement be =
+                               new TcpTransportBindingElement ();
+                       Assert.AreEqual (TimeSpan.FromSeconds (5), 
be.ChannelInitializationTimeout, "#1");
+                       Assert.AreEqual (0x2000, be.ConnectionBufferSize, "#2");
+                       Assert.AreEqual (HostNameComparisonMode.StrongWildcard, 
be.HostNameComparisonMode, "#3");
+                       Assert.AreEqual (0x10000, be.MaxBufferSize, "#4");
+                       Assert.AreEqual (TimeSpan.FromMilliseconds (200), 
be.MaxOutputDelay, "#5");
+                       Assert.AreEqual (1, be.MaxPendingAccepts, "#6");
+                       Assert.AreEqual (10, be.MaxPendingConnections, "#7");
+                       Assert.AreEqual (TransferMode.Buffered, 
be.TransferMode, "#8");
+
+                       Assert.AreEqual (10, be.ListenBacklog, "#9");
+                       Assert.IsFalse (be.PortSharingEnabled, "#10");
+                       Assert.AreEqual ("net.tcp", be.Scheme, "#11");
+                       Assert.IsFalse (be.TeredoEnabled, "#12");
+                       TcpConnectionPoolSettings pool = 
be.ConnectionPoolSettings;
+                       Assert.IsNotNull (pool, "#13");
+                       Assert.AreEqual ("default", pool.GroupName, "#14");
+                       Assert.AreEqual (TimeSpan.FromSeconds (120), 
pool.IdleTimeout, "#15");
+                       Assert.AreEqual (TimeSpan.FromSeconds (300), 
pool.LeaseTimeout, "#16");
+                       Assert.AreEqual (10, 
pool.MaxOutboundConnectionsPerEndpoint, "#17");
+               }
+
+               [Test]
+               public void CanBuildChannelFactory ()
+               {
+                       TcpTransportBindingElement be =
+                               new TcpTransportBindingElement ();
+                       BindingContext ctx = new BindingContext (
+                               new CustomBinding (), empty_params);
+                       Assert.IsFalse 
(be.CanBuildChannelFactory<IRequestChannel> (ctx), "#1");
+                       Assert.IsFalse 
(be.CanBuildChannelFactory<IInputChannel> (ctx), "#2");
+                       Assert.IsFalse 
(be.CanBuildChannelFactory<IReplyChannel> (ctx), "#3");
+                       Assert.IsFalse 
(be.CanBuildChannelFactory<IOutputChannel> (ctx), "#4");
+
+                       Assert.IsFalse 
(be.CanBuildChannelFactory<IRequestSessionChannel> (ctx), "#5");
+                       Assert.IsFalse 
(be.CanBuildChannelFactory<IInputSessionChannel> (ctx), "#6");
+                       Assert.IsFalse 
(be.CanBuildChannelFactory<IReplySessionChannel> (ctx), "#7");
+                       Assert.IsFalse 
(be.CanBuildChannelFactory<IOutputSessionChannel> (ctx), "#8");
+
+                       // IServiceChannel is not supported
+                       Assert.IsFalse 
(be.CanBuildChannelFactory<IServiceChannel> (ctx), "#9");
+                       Assert.IsFalse 
(be.CanBuildChannelFactory<IClientChannel> (ctx), "#10");
+
+                       Assert.IsTrue 
(be.CanBuildChannelFactory<IDuplexSessionChannel> (ctx), "#11");
+                       Assert.IsTrue 
(be.CanBuildChannelFactory<IDuplexSessionChannel> (ctx), "#12");
+               }
+
+               [Test]
+               public void CanBuildChannelListener ()
+               {
+                       TcpTransportBindingElement be =
+                               new TcpTransportBindingElement ();
+                       BindingContext ctx = new BindingContext (
+                               new CustomBinding (), empty_params);
+                       Assert.IsFalse 
(be.CanBuildChannelListener<IReplyChannel> (ctx), "#1");
+                       Assert.IsFalse 
(be.CanBuildChannelListener<IOutputChannel> (ctx), "#2");
+                       Assert.IsFalse 
(be.CanBuildChannelListener<IRequestChannel> (ctx), "#3");
+                       Assert.IsFalse 
(be.CanBuildChannelListener<IInputChannel> (ctx), "#4");
+
+                       Assert.IsFalse 
(be.CanBuildChannelListener<IReplySessionChannel> (ctx), "#5");
+                       Assert.IsFalse 
(be.CanBuildChannelListener<IOutputSessionChannel> (ctx), "#6");
+                       Assert.IsFalse 
(be.CanBuildChannelListener<IRequestSessionChannel> (ctx), "#7");
+                       Assert.IsFalse 
(be.CanBuildChannelListener<IInputSessionChannel> (ctx), "#8");
+
+                       // IServiceChannel is not supported
+                       Assert.IsFalse 
(be.CanBuildChannelListener<IServiceChannel> (ctx), "#9");
+                       Assert.IsFalse 
(be.CanBuildChannelListener<IClientChannel> (ctx), "#10");
+
+                       Assert.IsFalse 
(be.CanBuildChannelListener<IDuplexChannel> (ctx), "#11");
+                       Assert.IsTrue 
(be.CanBuildChannelListener<IDuplexSessionChannel> (ctx), "#12");
+               }
+       }
+}


Property changes on: 
trunk/olive/class/System.ServiceModel/Test/System.ServiceModel.Channels/TcpTransportBindingElementTest.cs
___________________________________________________________________
Name: svn:eol-style
   + native

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to