public override IChannelListener <TChannel> BuildChannelListener <TChannel>(BindingContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            if (!this.CanBuildChannelListener <TChannel>(context))
            {
                throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Unsupported channel type: {0}.", typeof(TChannel).Name));
            }

            UdpChannelListener channelListener = new UdpChannelListener(this, context);

            VirtualPathExtension virtualPathExtension = context.BindingParameters.Find <VirtualPathExtension>();

            if (virtualPathExtension != null)
            {
                channelListener.SetVirtualPath(virtualPathExtension.VirtualPath);
            }

            return((IChannelListener <TChannel>)(object) channelListener);
        }
Ejemplo n.º 2
0
        public void Dispatch(FramingData data)
        {
            UdpChannelListener channelListener = channelListeners.Lookup(data.To);

            channelListener.OnRawMessageReceived(data.Payload);
        }
Ejemplo n.º 3
0
 public static UdpTransportManager LookUp(UdpChannelListener channelListener)
 {
     return(transportManagers.Lookup(channelListener.Uri));
 }
Ejemplo n.º 4
0
 public void Register(UdpChannelListener channelListener)
 {
     channelListeners.Add(channelListener.Uri, channelListener);
 }
Ejemplo n.º 5
0
 internal UdpInputChannel(UdpChannelListener listener)
     : base(listener)
 {
     this.encoder      = listener.MessageEncoderFactory.Encoder;
     this.messageQueue = new InputQueue <Message>();
 }