flattest commit yet
This commit is contained in:
parent
4b0fbf2793
commit
0662828b42
4 changed files with 20 additions and 4 deletions
2
server/src/sock/pool.cpp
Normal file
2
server/src/sock/pool.cpp
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
#include "pool.hpp"
|
||||||
|
|
14
server/src/sock/pool.hpp
Normal file
14
server/src/sock/pool.hpp
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
#ifndef SOSC_POOL_H
|
||||||
|
#define SOSC_POOL_H
|
||||||
|
|
||||||
|
namespace sosc {
|
||||||
|
template<typename T>
|
||||||
|
class Pool {
|
||||||
|
public:
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
|
@ -91,13 +91,13 @@ int sosc::ScapeConnection::Receive(Packet* packet, bool block) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO optimize
|
// TODO optimize
|
||||||
this->multiframe_buffer += frame.GetBody();
|
// TODO determine if packet->Parse should write back to pck_frames on o/f
|
||||||
|
this->pck_frames += frame.GetBody();
|
||||||
if(frame.IsFinal()) {
|
if(frame.IsFinal()) {
|
||||||
if(packet->Parse(this->multiframe_buffer) == PCK_OK)
|
if(packet->Parse(this->pck_frames, &this->pck_frames) == PCK_OK)
|
||||||
return PCK_OK;
|
return PCK_OK;
|
||||||
else
|
else
|
||||||
return PCK_ERR;
|
return PCK_ERR;
|
||||||
|
|
||||||
} else
|
} else
|
||||||
return PCK_MORE;
|
return PCK_MORE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ private:
|
||||||
TcpClient client;
|
TcpClient client;
|
||||||
|
|
||||||
std::string buffer;
|
std::string buffer;
|
||||||
std::string multiframe_buffer;
|
std::string pck_frames;
|
||||||
|
|
||||||
friend class ScapeServer;
|
friend class ScapeServer;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue