コード例 #1
0
 public TcpDuplexSessionChannel(ChannelListenerBase listener, TcpChannelInfo info, TcpClient client)
     : base(listener)
 {
     is_service_side     = true;
     this.client         = client;
     this.info           = info;
     counterpart_address = GetEndpointAddressFromTcpClient(client);
 }
コード例 #2
0
        public PeerDuplexChannel(IPeerChannelManager listener)
            : base((ChannelListenerBase)listener)
        {
            binding       = listener.Source;
            this.resolver = listener.Resolver;
            info          = new TcpChannelInfo(binding, listener.MessageEncoder, null);     // FIXME: fill properties correctly.

            node = new PeerNodeImpl(((ChannelListenerBase)listener).Uri.Host, listener.Source.ListenIPAddress, listener.Source.Port);
        }
コード例 #3
0
        public PeerDuplexChannel(IPeerChannelManager factory, EndpointAddress address, Uri via, PeerResolver resolver)
            : base((ChannelFactoryBase)factory, address, via)
        {
            binding       = factory.Source;
            this.resolver = factory.Resolver;
            info          = new TcpChannelInfo(binding, factory.MessageEncoder, null);     // FIXME: fill properties correctly.

            // It could be opened even with empty list of PeerNodeAddresses.
            // So, do not create PeerNode per PeerNodeAddress, but do it with PeerNodeAddress[].
            node = new PeerNodeImpl(RemoteAddress.Uri.Host, factory.Source.ListenIPAddress, factory.Source.Port);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
ファイル: TcpChannelFactory.cs プロジェクト: mdae/MonoRT
        public TcpChannelFactory(TcpTransportBindingElement source, BindingContext ctx)
        {
            MessageEncoder            encoder = null;
            XmlDictionaryReaderQuotas quotas  = null;

            foreach (BindingElement be in ctx.RemainingBindingElements)
            {
                MessageEncodingBindingElement mbe = be as MessageEncodingBindingElement;
                if (mbe != null)
                {
                    encoder = CreateEncoder <TChannel> (mbe);
                    quotas  = mbe.GetProperty <XmlDictionaryReaderQuotas> (ctx);
                    break;
                }
            }
            if (encoder == null)
            {
                encoder = new BinaryMessageEncoder();
            }
            info = new TcpChannelInfo(source, encoder, quotas);
        }
コード例 #6
0
ファイル: TcpChannelListener.cs プロジェクト: yonder/mono
        public TcpChannelListener(TcpTransportBindingElement source, BindingContext context)
            : base(context)
        {
            XmlDictionaryReaderQuotas quotas = null;

            foreach (BindingElement be in context.Binding.Elements)
            {
                MessageEncodingBindingElement mbe = be as MessageEncodingBindingElement;
                if (mbe != null)
                {
                    MessageEncoder = CreateEncoder <TChannel> (mbe);
                    quotas         = mbe.GetProperty <XmlDictionaryReaderQuotas> (context);
                    break;
                }
            }

            if (MessageEncoder == null)
            {
                MessageEncoder = new BinaryMessageEncoder();
            }

            info = new TcpChannelInfo(source, MessageEncoder, quotas);
        }
コード例 #7
0
ファイル: TcpReplyChannel.cs プロジェクト: mdae/MonoRT
 public TcpReplyChannel(ChannelListenerBase listener, TcpChannelInfo info, TcpClient client)
     : base(listener)
 {
     this.client = client;
     this.info   = info;
 }
コード例 #8
0
ファイル: TcpRequestChannel.cs プロジェクト: mdae/MonoRT
 public TcpRequestChannel(ChannelFactoryBase factory, TcpChannelInfo info, EndpointAddress address, Uri via)
     : base(factory, address, via)
 {
     this.info = info;
 }