/// <summary> /// 数据第二层分配中心;把数据归类 /// </summary> /// <param name="stateOne"></param> /// <param name="statecode"></param> internal void codeManage(StateBase stateOne, StateCode statecode) { if (statecode == null || stateOne == null) { return; } StateCode stateCode = null; switch (statecode.State) { case PasswordCode._commonCode: //普通数据信息;抛给普通Code去处理 stateCode = EncryptionDecrypt.deciphering(statecode.DateByte, stateOne); CommonCodeManage(stateOne, stateCode); break; case PasswordCode._bigDateCode: //抛给分包Code去处理 stateCode = EncryptionDecryptSeparateDate.FileDecrypt(statecode.DateByte, stateOne); CommonCodeManage(stateOne, stateCode); break; case PasswordCode._fileCode: //抛给文件处理器去处理;如果返回null就不用发送了 byte[] haveDate = FileStart.ReceiveDateTO(statecode.DateByte, stateOne); if (haveDate != null) { Send(stateOne, haveDate); } break; } }
/// <summary> /// 数据第二层分配中心;把数据归类 /// </summary> /// <param name="stateOne">连接属性</param> /// <param name="statecode">收到的数据</param> internal void codeManage(TransmitData stateOne, DataModel statecode) { if (statecode == null || stateOne == null) { return; } DataModel stateCode = null; switch (statecode.State) { case CipherCode._commonCode: //普通数据信息;抛给普通Code去处理 stateCode = EncryptionDecrypt.deciphering(statecode.DateByte, stateOne); CommonCodeManage(stateOne, stateCode); break; case CipherCode._bigDateCode: //抛给分包Code去处理 stateCode = EncDecSeparateDate.FileDecrypt(statecode.DateByte, stateOne); //返回一个带回复数据的模型 CommonCodeManage(stateOne, stateCode); //发送出去 break; case CipherCode._fileCode: //抛给文件处理器去处理;如果返回null就不用发送了 byte[] haveDate = FileStart.ReceiveDateTO(statecode.DateByte, stateOne); if (haveDate != null) { Send(stateOne, haveDate); } break; } }