Ejemplo n.º 1
0
        /// <summary>
        /// Creates a new instance of the TcpBinaryServerProtocolSetup class.
        /// </summary>
        /// <param name="versioning">Versioning behavior</param>
        public TcpBinaryServerProtocolSetup(Versioning versioning)
            : base((settings, clientSinkChain, serverSinkChain) => new TcpChannel(settings, clientSinkChain, serverSinkChain))
        {
            SocketCachingEnabled = true;
            _channelName = "TcpBinaryServerProtocolSetup_" + Guid.NewGuid().ToString();
            _versioning = versioning;

            Hashtable formatterSettings = new Hashtable();
            formatterSettings.Add("includeVersions", _versioning == Versioning.Strict);
            formatterSettings.Add("strictBinding", _versioning == Versioning.Strict);

            ClientSinkChain.Add(new SafeBinaryClientFormatterSinkProvider(formatterSettings, null));
            ServerSinkChain.Add(new SafeBinaryServerFormatterSinkProvider(formatterSettings, null) { TypeFilterLevel = TypeFilterLevel.Full });
            ServerSinkChain.Add(new ClientAddressServerChannelSinkProvider());
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates a new instance of the IpcBinaryClientProtocolSetup class.
        /// </summary>
        /// <param name="versioning">Versioning behavior</param>
        public IpcBinaryClientProtocolSetup(Versioning versioning)
            : base((settings, clientSinkChain, serverSinkChain) => new IpcChannel(settings, clientSinkChain, serverSinkChain))
        {
            _channelName = "IpcBinaryClientProtocol_" + Guid.NewGuid().ToString();
            _versioning  = versioning;

            Hashtable formatterSettings = new Hashtable();

            formatterSettings.Add("includeVersions", _versioning == Versioning.Strict);
            formatterSettings.Add("strictBinding", _versioning == Versioning.Strict);

            ClientSinkChain.Add(new BinaryClientFormatterSinkProvider(formatterSettings, null));
            ServerSinkChain.Add(new BinaryServerFormatterSinkProvider(formatterSettings, null)
            {
                TypeFilterLevel = TypeFilterLevel.Full
            });
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Creates a new instance of the TcpDuplexServerProtocolSetup class.
        /// </summary>
        /// <param name="versioning">Versioning behavior</param>
        public TcpDuplexServerProtocolSetup(Versioning versioning)
            : base((settings, clientSinkChain, serverSinkChain) => new TcpExChannel(settings, clientSinkChain, serverSinkChain))
        {
            _versioning = versioning;

            Hashtable formatterSettings = new Hashtable();

            formatterSettings.Add("includeVersions", _versioning == Versioning.Strict);
            formatterSettings.Add("strictBinding", _versioning == Versioning.Strict);

            ClientSinkChain.Add(new SafeBinaryClientFormatterSinkProvider(formatterSettings, null));
            ServerSinkChain.Add(new SafeBinaryServerFormatterSinkProvider(formatterSettings, null)
            {
                TypeFilterLevel = TypeFilterLevel.Full
            });
            ServerSinkChain.Add(new ClientAddressServerChannelSinkProvider());
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Creates a new instance of the HttpCustomClientProtocolSetup class.
        /// </summary>
        /// <param name="versioning">Versioning behavior</param>
        /// <param name="webProxy">Defines HTTP proxy settings</param>
        public HttpCustomClientProtocolSetup(Versioning versioning, IWebProxy webProxy)
            : base((settings, clientSinkChain, serverSinkChain) => new HttpChannel(settings, clientSinkChain, serverSinkChain))
        {
            _channelName = "HttpCustomClientProtocolSetup" + Guid.NewGuid().ToString();
            _versioning  = versioning;

            Hashtable formatterSettings = new Hashtable();

            formatterSettings.Add("includeVersions", _versioning == Versioning.Strict);
            formatterSettings.Add("strictBinding", _versioning == Versioning.Strict);

            WebRequest.DefaultWebProxy = webProxy;

            ClientSinkChain.Add(new BinaryClientFormatterSinkProvider(formatterSettings, null));
            ServerSinkChain.Add(new BinaryServerFormatterSinkProvider(formatterSettings, null)
            {
                TypeFilterLevel = TypeFilterLevel.Full
            });
        }