public TcpDuplexSessionChannel(ChannelListenerBase listener, TcpChannelInfo info, TcpClient client)
     : base(listener)
 {
     is_service_side     = true;
     this.client         = client;
     this.info           = info;
     counterpart_address = GetEndpointAddressFromTcpClient(client);
 }
        public TcpDuplexSessionChannel(ChannelFactoryBase factory, TcpChannelInfo info, EndpointAddress address, Uri via)
            : base(factory, address, via)
        {
            is_service_side = false;
            this.info       = info;

            // make sure to acquire TcpClient here.
            int explicitPort = Via.Port;

            client = new TcpClient(Via.Host, explicitPort <= 0 ? TcpTransportBindingElement.DefaultPort : explicitPort);
            counterpart_address = GetEndpointAddressFromTcpClient(client);
        }
Exemplo n.º 3
0
        public TcpChannelFactory(TcpTransportBindingElement source, BindingContext ctx)
            : base(source, ctx)
        {
            XmlDictionaryReaderQuotas quotas = null;

            foreach (BindingElement be in ctx.Binding.Elements)
            {
                MessageEncodingBindingElement mbe = be as MessageEncodingBindingElement;
                if (mbe != null)
                {
                    MessageEncoder = CreateEncoder <TChannel> (mbe);
                    quotas         = mbe.GetProperty <XmlDictionaryReaderQuotas> (ctx);
                    break;
                }
            }
            if (MessageEncoder == null)
            {
                MessageEncoder = new BinaryMessageEncoder();
            }
            info = new TcpChannelInfo(source, MessageEncoder, quotas);
        }
Exemplo n.º 4
0
 public TcpReplyChannel(ChannelListenerBase listener, TcpChannelInfo info, TcpClient client)
     : base(listener)
 {
     this.client = client;
     this.info   = info;
 }
Exemplo n.º 5
0
 public TcpRequestChannel(ChannelFactoryBase factory, TcpChannelInfo info, EndpointAddress address, Uri via)
     : base(factory, address, via)
 {
     this.info = info;
 }