diff --git a/reflector/UnixDgramSocket.cpp b/reflector/UnixDgramSocket.cpp index dddf4cf..ff21399 100644 --- a/reflector/UnixDgramSocket.cpp +++ b/reflector/UnixDgramSocket.cpp @@ -81,6 +81,11 @@ bool CUnixDgramReader::Receive(STCPacket *pack, unsigned timeout) const return false; } + return Read(pack); +} + +bool CUnixDgramReader::Read(STCPacket *pack) const +{ auto len = read(fd, pack, sizeof(STCPacket)); if (len != sizeof(STCPacket)) { std::cerr << "Received transcoder packet is wrong size: " << len << " but should be " << sizeof(STCPacket) << std::endl; diff --git a/reflector/UnixDgramSocket.h b/reflector/UnixDgramSocket.h index 2b06d87..1f044e7 100644 --- a/reflector/UnixDgramSocket.h +++ b/reflector/UnixDgramSocket.h @@ -28,6 +28,7 @@ public: CUnixDgramReader(); ~CUnixDgramReader(); bool Open(const char *path); + bool Read(STCPacket *pack) const; bool Receive(STCPacket *pack, unsigned timeout) const; void Close(); int GetFD() const;