using System.Collections.Generic;
using System.Net;
using System.ServiceModel.Channels;
+using System.ServiceModel.Channels.NetTcp;
using System.ServiceModel.Description;
namespace System.ServiceModel.Channels
{
- [MonoTODO]
public class TcpTransportBindingElement
: ConnectionOrientedTransportBindingElement
{
set { teredo_enabled = value; }
}
- [MonoTODO]
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);
}
return new TcpTransportBindingElement (this);
}
- [MonoTODO]
public override T GetProperty<T> (BindingContext context)
{
- // FIXME: ... or return ISecurityCapabilities?
- return context.GetInnerProperty<T> ();
+ if (typeof (T) == typeof (IBindingDeliveryCapabilities))
+ return (T) (object) new TcpBindingProperties (this);
+ return base.GetProperty<T> (context);
+ }
+ }
+
+ class TcpBindingProperties : IBindingDeliveryCapabilities
+ {
+ TcpTransportBindingElement source;
+
+ public TcpBindingProperties (TcpTransportBindingElement source)
+ {
+ this.source = source;
+ }
+
+ public bool AssuresOrderedDelivery {
+ get { return true; }
+ }
+
+ public bool QueuedDelivery {
+ get { return false; }
}
}
}