예제 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="server"></param>
        /// <param name="client"></param>
        /// <param name="token"></param>
        /// <param name="logger"></param>
        /// <param name="meta"></param>
        /// <param name="globalMeta"></param>
        /// <param name="properties"></param>
        /// <param name="defaultBinding"></param>
        public void Negotiate(ref IDataAdapter server, ref IDataAdapter client, ProxyToken token, Logger logger,
                              MetaDictionary meta, MetaDictionary globalMeta, PropertyBag properties, NetworkLayerBinding defaultBinding)
        {
            if (defaultBinding == NetworkLayerBinding.Default)
            {
                defaultBinding = NetworkLayerBinding.ClientAndServer;
            }

            if (Binding != NetworkLayerBinding.Default)
            {
                defaultBinding = Binding;
            }

            if ((defaultBinding & NetworkLayerBinding.Server) == NetworkLayerBinding.Server)
            {
                server = new HttpRequestDataAdapter(server, logger, this);
            }

            if ((defaultBinding & NetworkLayerBinding.Client) == NetworkLayerBinding.Client)
            {
                client = new HttpResponseDataAdapter(client, logger, this);
            }
        }
예제 #2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="server"></param>
        /// <param name="client"></param>
        /// <param name="token"></param>
        /// <param name="logger"></param>
        /// <param name="meta"></param>
        /// <param name="globalMeta"></param>
        /// <param name="properties"></param>
        /// <param name="defaultBinding"></param>
        public void Negotiate(ref IDataAdapter server, ref IDataAdapter client, ProxyToken token, Logger logger, 
            MetaDictionary meta, MetaDictionary globalMeta, PropertyBag properties, NetworkLayerBinding defaultBinding)
        {
            if (defaultBinding == NetworkLayerBinding.Default)
            {
                defaultBinding = NetworkLayerBinding.ClientAndServer;
            }

            if (Binding != NetworkLayerBinding.Default)
            {
                defaultBinding = Binding;
            }

            if ((defaultBinding & NetworkLayerBinding.Server) == NetworkLayerBinding.Server)
            {
                server = new HttpRequestDataAdapter(server, logger, this);
            }

            if ((defaultBinding & NetworkLayerBinding.Client) == NetworkLayerBinding.Client)
            {
                client = new HttpResponseDataAdapter(client, logger, this);
            }
        }