コード例 #1
0
 public void AddCommand(string commandName, FunctionHandler.VoidInVoidOutHandlerDelegate responseFunction)
 {
     if (commandName != null && responseFunction != null)
     {
         var cmdHash = HashAlgoProvider.HashBytes(Encoding.UTF8.GetBytes(commandName), HashAlgorithmName.SHA256);
         var fh      = new FunctionHandler(cmdHash, commandName, FunctionHandlerType.VoidInVoidOut, responseFunction);
         CommandList.Add(commandName, fh);
         CommandHashMap.Add(commandName, cmdHash);
     }
 }
コード例 #2
0
ファイル: OTcpCommands.cs プロジェクト: karusb/ObjectTCP
        protected void AddCommandHash(string command)
        {
            var cmdHash = HashAlgoProvider.HashBytes(Encoding.UTF8.GetBytes(command), HashAlgorithmName.SHA256);

            CommandHashMap.Add(command, cmdHash);
        }