mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
Servd: Add pushRx error
This commit is contained in:
+5
-1
@@ -243,6 +243,7 @@ bool Servd::enableCommunication(bool enable, bool& sendMsg) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Servd::read() {
|
void Servd::read() {
|
||||||
|
EventManager::GetInstance().downgradeErrorsOnCurrentThread();
|
||||||
std::vector<uint8_t> buf(2 * 1024 * 1024);
|
std::vector<uint8_t> buf(2 * 1024 * 1024);
|
||||||
while(!isDisconnected() && !isClosing()) {
|
while(!isDisconnected() && !isClosing()) {
|
||||||
bool hasData;
|
bool hasData;
|
||||||
@@ -260,11 +261,14 @@ void Servd::read() {
|
|||||||
setIsDisconnected(true);
|
setIsDisconnected(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
pushRx(buf.data(), bufSize);
|
if(!pushRx(buf.data(), bufSize)) {
|
||||||
|
EventManager::GetInstance().add(APIEvent::Type::FailedToRead, APIEvent::Severity::Error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Servd::write() {
|
void Servd::write() {
|
||||||
|
EventManager::GetInstance().downgradeErrorsOnCurrentThread();
|
||||||
WriteOperation writeOp;
|
WriteOperation writeOp;
|
||||||
while(!isDisconnected() && !isClosing()) {
|
while(!isDisconnected() && !isClosing()) {
|
||||||
if(!writeQueue.wait_dequeue_timed(writeOp, std::chrono::milliseconds(100))) {
|
if(!writeQueue.wait_dequeue_timed(writeOp, std::chrono::milliseconds(100))) {
|
||||||
|
|||||||
Reference in New Issue
Block a user