예제 #1
0
        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);
        }
예제 #2
0
 /// <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;
 }
예제 #3
0
        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);
        }
예제 #4
0
 /// <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;
 }
예제 #5
0
 /// <summary>
 /// 设置服务端任务类型
 /// </summary>
 /// <param name="taskType"></param>
 internal override void SetServerTaskType(ServerTaskType taskType)
 {
     ServerTask = taskType;
 }
예제 #6
0
 /// <summary>
 /// 设置服务端任务类型
 /// </summary>
 /// <param name="taskType"></param>
 internal virtual void SetServerTaskType(ServerTaskType taskType)
 {
 }