Example #1
0
    //异步发送
    public void send(string sendData, LuaFunction lf, LuaFunction ef)
    {
        AsyncInvokeContext aic = new AsyncInvokeContext(this, sendData);

        aic.setLFunction(lf);
        aic.setLerrorFunction(ef);

        //Debug.Log("C#::HttpLuaClient::asyncSend(" + sendData + ", " + lf.ToString()  + ", " + ef.ToString() + ")");

        aic.Invoke();
    }
Example #2
0
    //-------------------------------------------------
    //异步发送
    public bool send(string sendData, LuaFunction lf)
    {
        AsyncInvokeContext aic = new AsyncInvokeContext(this, sendData);

        aic.setLFunction(lf);

        //Debug.Log("C#::HttpLuaClient::asyncSend(" + sendData + ", " + lf + ")");

        aic.Invoke();
        return(true);
    }
Example #3
0
        private void Invoke(string functionName, object[] arguments, HproseCallback callback, HproseErrorEvent errorEvent, Type returnType, bool byRef, HproseResultMode resultMode)
        {
            if (errorEvent == null)
            {
                errorEvent = OnError;
            }
            AsyncInvokeContext context = new AsyncInvokeContext(this, functionName, arguments, callback, errorEvent, returnType, byRef, resultMode);

            try {
                BeginGetOutputStream(new AsyncCallback(context.GetOutputStream), GetInvokeContext());
            }
            catch (Exception e) {
                if (errorEvent != null)
                {
                    errorEvent(functionName, e);
                }
            }
        }
Example #4
0
        public void Invoke <T>(string functionName, object[] arguments, HproseCallback <T> callback, HproseErrorEvent errorEvent, bool byRef)
        {
            if (errorEvent == null)
            {
                errorEvent = OnError;
            }
            AsyncInvokeContext <T> context = new AsyncInvokeContext <T>(this, functionName, arguments, callback, errorEvent, byRef);

            try {
                BeginGetOutputStream(new AsyncCallback(context.GetOutputStream), GetInvokeContext());
            }
            catch (Exception e) {
                if (errorEvent != null)
                {
                    errorEvent(functionName, e);
                }
            }
        }