Optimization that allows Socket::Buffer to write directly to a Util::ResizeablePointer

This commit is contained in:
Thulinma 2023-03-27 23:16:51 +02:00
parent 364441c435
commit 4df771eb02
7 changed files with 55 additions and 25 deletions

View file

@ -30,11 +30,15 @@ AnalyserDTSC::AnalyserDTSC(Util::Config &conf) : Analyser(conf){
bool AnalyserDTSC::parsePacket(){
if (headLess){
Util::ResizeablePointer dataBuf;
while (conn){
if (!conn.spool()){Util::sleep(50);}
if (conn.spool()){
conn.Received().remove(dataBuf, conn.Received().bytes(0xFFFFFFFFul));
}else{
Util::sleep(50);
}
}
std::string dataBuf = conn.Received().remove(conn.Received().bytes(0xFFFFFFFFul));
DTSC::Scan S((char *)dataBuf.data(), dataBuf.size());
DTSC::Scan S(dataBuf, dataBuf.size());
std::cout << S.toPrettyString() << std::endl;
return false;
}