Ejemplo n.º 1
0
        public bool Bind(IDFStream outStream, RemoteFunctionBase function,
                         string name, string proto)
        {
            if (!_active || Socket == null)
            {
                return(false);
            }

            _bindCall.Reset();

            {
                var input = _bindCall.Input;

                input.method = name;
                if (proto.Length != 0)
                {
                    input.plugin = proto;
                }
                input.input_msg  = function.PInTemplate.GetType().ToString();
                input.output_msg = function.POutTemplate.GetType().ToString();
            }

            if (_bindCall.TryExecute(outStream) != CommandResult.CrOk)
            {
                return(false);
            }

            function.Id = (Int16)_bindCall.Output.assigned_id;

            return(true);
        }
Ejemplo n.º 2
0
        public bool bind(color_ostream outStream, RemoteFunctionBase function,
                         string name, string proto)
        {
            if (!active || socket == null)
            {
                return(false);
            }

            bind_call.reset();

            {
                var input = bind_call.input;

                input.method = name;
                if (proto.Length != 0)
                {
                    input.plugin = proto;
                }
                input.input_msg  = function.p_in_template.GetType().ToString();
                input.output_msg = function.p_out_template.GetType().ToString();
            }

            if (bind_call.execute(outStream) != command_result.CR_OK)
            {
                return(false);
            }

            function.id = (Int16)bind_call.output.assigned_id;

            return(true);
        }