Пример #1
0
        private void Invoke(string functionName, object[] arguments, HproseCallback1 callback, HproseErrorEvent errorEvent, Type returnType, HproseResultMode resultMode)
        {
            if (errorEvent == null)
            {
                errorEvent = OnError;
            }
            AsyncInvokeContext1 context = new AsyncInvokeContext1(this, functionName, arguments, callback, errorEvent, returnType, resultMode);

            try {
                BeginGetOutputStream(new AsyncCallback(context.GetOutputStream), GetInvokeContext());
            }
            catch (Exception e) {
                if (errorEvent != null)
                {
                    errorEvent(functionName, e);
                }
            }
        }
Пример #2
0
        public void Invoke <T>(string functionName, object[] arguments, HproseCallback1 <T> callback, HproseErrorEvent errorEvent)
        {
            if (errorEvent == null)
            {
                errorEvent = OnError;
            }
            AsyncInvokeContext1 <T> context = new AsyncInvokeContext1 <T>(this, functionName, arguments, callback, errorEvent);

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