Esempio n. 1
0
 private int addCustom(IndexIdentity identity, ClientTask.Custom custom)
 {
     if ((uint)identity.Index < (uint)deployPool.PoolIndex)
     {
         object arrayLock = deployPool.ArrayLock;
         Monitor.Enter(arrayLock);
         try
         {
             return(deployPool.Array[identity.Index].AddTask(identity.Identity, new Task {
                 RunFileName = custom.CallName, CustomData = custom.CustomData, Type = TaskType.Custom
             }));
         }
         finally { Monitor.Exit(arrayLock); }
     }
     return(-1);
 }
Esempio n. 2
0
 /// <summary>
 /// 调用自定义任务
 /// </summary>
 /// <param name="server"></param>
 /// <param name="task"></param>
 /// <returns></returns>
 public virtual DeployResultData Call(Server server, ClientTask.Custom task)
 {
     return(DeployState.Success);
 }
Esempio n. 3
0
 /// <summary>
 /// 自定义任务处理
 /// </summary>
 /// <param name="task"></param>
 /// <returns></returns>
 public virtual DeployState CallCustomTask(ClientTask.Custom task)
 {
     return(DeployState.CustomError);
 }
Esempio n. 4
0
        protected virtual int addCustom(AutoCSer.Net.TcpInternalServer.ServerSocketSender sender, ClientTask.Custom custom)
        {
            DeployInfo deployInfo = ((ClientObject)sender.ClientObject).CurrentDeploy;

            if (deployInfo != null)
            {
                custom.Sender = sender;
                return(deployInfo.AddTask(custom));
            }
            return(-1);
        }
Esempio n. 5
0
 private int addCustom(AutoCSer.Net.TcpInternalServer.ServerSocketSender sender, IndexIdentity identity, ClientTask.Custom custom)
 {
     if ((uint)identity.Index < (uint)deployPool.PoolIndex && checkCustom(sender, custom.CallName))
     {
         object arrayLock = deployPool.ArrayLock;
         Monitor.Enter(arrayLock);
         try
         {
             return(deployPool.Array[identity.Index].AddTask(identity.Identity, new Task {
                 Sender = sender, RunFileName = custom.CallName, CustomData = custom.CustomData, Type = TaskType.Custom
             }));
         }
         finally { Monitor.Exit(arrayLock); }
     }
     return(-1);
 }