Close 返回结果

去掉无关代码
This commit is contained in:
WangQiang 2016-08-22 08:56:52 +00:00
parent 8f26f24cd5
commit bd10e33663
1 changed files with 1 additions and 28 deletions

View File

@ -94,6 +94,7 @@ bool ProxyFactory::PortClose(const Pair& args, Stream& result)
{
rsbp.Set("ErrorCode", (byte)0x04);
}
result.Write((byte)1);
}
return true;
@ -164,10 +165,6 @@ bool ProxyFactory::GetConfig(const Pair& args, Stream& result)
}
else
{
// String str;
// port->GetConfig(str); // 调用端口的函数处理内容
// ms.Write(str);
Dictionary<char*, int> cfg;
port->GetConfig(cfg); // 调用端口的函数处理内容
@ -177,40 +174,16 @@ bool ProxyFactory::GetConfig(const Pair& args, Stream& result)
return false;
}
// 数据先写进缓冲区ms2
//MemoryStream ms2;
//auto name = cfg.Keys();
//auto value = cfg.Values();
// debug_printf("cfg count : %d value count : %d\t\t", name.Count(), value.Count());
String str;
debug_printf("config:\r\n");
/*for (int i = 0; i < cfg.Count(); i++)
{
debug_printf("%s %d\r\n",name[i],value[i]);
str = str + name[i] + '=' + value[i];
if (i < cfg.Count() - 1)str = str + '&';
}*/
for(int i=0; i<cfg.Count(); i++)
{
if(i>0) str += '&';
str = str + cfg.Keys()[i] + '=' + cfg.Values()[i];
}
str.Show(true);
//ms.Write(str);
result.Write(str);
// for (int i = 0; i < cfg.Count(); i++)
// {
// ms2.Write(String(name[i]));
// ms2.Write('=');
// ms2.Write(String(value[i]));
// if (i < cfg.Count() - 1) ms2.Write('&');
// }
// // 然后组成名词对写进回复数据内去
// BinaryPair bp(ms);
// bp.Set("Config", Buffer(ms2.GetBuffer(), ms2.Position()));
}
return true;