/// <summary>
        /// 响应消息
        /// </summary>
        /// <param name="proxy"></param>
        /// <param name="method"></param>
        /// <param name="parameters"></param>
        /// <returns></returns>
        public object Invoke(object proxy, System.Reflection.MethodInfo method, object[] parameters)
        {
            if (client.CommunicationState == CommunicationStates.Connected)
            {
                //定义回调的消息
                var message = new CallbackMessage
                {
                    ServiceName = callType.FullName,
                    MethodName = method.ToString(),
                    Parameters = parameters
                };

                //加入队列
                lock (queue.SyncRoot)
                {
                    queue.Enqueue(new CallbackInfo
                    {
                        Client = client,
                        Message = message
                    });
                }

                //返回null
                return null;
            }
            else
            {
                throw new SocketException((int)SocketError.ConnectionAborted);
            }
        }
Example #2
0
 public ScsCallbackMessage(CallbackMessage value)
 {
     this.MessageValue = value;
 }
 public ScsCallbackMessage(CallbackMessage value)
 {
     this.MessageValue = value;
 }