public bool CheckCall(ServerTaskType taskType, byte callQueueIndex, ServerBase server) { switch (taskType) { case ServerTaskType.Queue: return(server.CallQueueArray[callQueueIndex].Key.CheckAdd(this)); case ServerTaskType.QueueLink: return(server.CallQueueArray[callQueueIndex].Value.CheckAdd(this)); } return(false); }
/// <summary> /// 设置配置数据 /// </summary> /// <param name="attribute"></param> internal void Set(ServerBaseAttribute attribute) { ServerName = attribute.ServerName; VerifyHashCode = attribute.VerifyHashCode; ReceiveVerifyCommandSeconds = attribute.GetReceiveVerifyCommandSeconds; if ((MaxInputSize = attribute.GetMaxInputSize) <= 0) { MaxInputSize = int.MaxValue; } OutputSleep = attribute.GetServerOutputSleep; IsBuildOutputThread = attribute.GetIsServerBuildOutputThread; RemoteExpressionTask = attribute.GetRemoteExpressionServerTask; RemoteExpressionCallQueueIndex = attribute.GetRemoteExpressionCallQueueIndex; }
public bool CheckCall(ServerTaskType taskType, ServerBase server = null) { switch (taskType) { case ServerTaskType.ThreadPool: return(System.Threading.ThreadPool.QueueUserWorkItem(ThreadPoolCall) || AutoCSer.Threading.TaskSwitchThreadArray.Default.CurrentThread.CheckAdd(this)); case ServerTaskType.Timeout: return(AutoCSer.Threading.TaskSwitchThreadArray.Default.CurrentThread.CheckAdd(this)); case ServerTaskType.TcpTask: return(ServerCallThreadArray.Default.CurrentThread.CheckAdd(this)); case ServerTaskType.TcpQueue: return(ServerCallQueue.Default.CheckAdd(this)); case ServerTaskType.TcpQueueLink: return(ServerCallQueue.DefaultLink.CheckAdd(this)); case ServerTaskType.Queue: return(server.CallQueue.CheckAdd(this)); case ServerTaskType.QueueLink: return(server.CallQueueLink.CheckAdd(this)); } return(false); }
/// <summary> /// TCP 服务套接字数据发送 /// </summary> /// <param name="socket">TCP 服务套接字</param> /// <param name="attribute"></param> internal ServerSocketSender(TcpServer.ServerSocket socket, ServerAttribute attribute) : base(socket, attribute.GetIsServerBuildOutputThread, attribute.GetServerOutputSleep) { ServerTaskType = attribute.ServerTaskType; }
/// <summary> /// 设置服务端任务类型 /// </summary> /// <param name="taskType"></param> internal override void SetServerTaskType(ServerTaskType taskType) { ServerTask = taskType; }
/// <summary> /// 设置服务端任务类型 /// </summary> /// <param name="taskType"></param> internal virtual void SetServerTaskType(ServerTaskType taskType) { }