mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-26 16:20:03 +02:00
merge resolved
This commit is contained in:
commit
5e6a3b7e3d
@ -90,18 +90,13 @@ class UdpRxSocket {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const char *LastPacket() const noexcept { return buff; }
|
const char *LastPacket() const noexcept { return buff; }
|
||||||
//constexpr
|
ssize_t getPacketSize() const noexcept { return packet_size; }
|
||||||
ssize_t getPacketSize() const noexcept { return packet_size; }
|
|
||||||
|
bool ReceivePacket() noexcept { return ReceivePacket(buff); }
|
||||||
bool ReceivePacket() noexcept {
|
|
||||||
auto bytes_received =
|
|
||||||
recvfrom(fd, buff, packet_size, 0, nullptr, nullptr);
|
|
||||||
return bytes_received == packet_size;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ReceivePacket(char *dst) noexcept {
|
bool ReceivePacket(char *dst) noexcept {
|
||||||
auto bytes_received =
|
auto bytes_received =
|
||||||
recvfrom(fd, buff, packet_size, 0, nullptr, nullptr);
|
recvfrom(fd, dst, packet_size, 0, nullptr, nullptr);
|
||||||
return bytes_received == packet_size;
|
return bytes_received == packet_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ TEST_CASE("Shutdown socket without hanging when waiting for data") {
|
|||||||
&sls::UdpRxSocket::ReceivePacket),
|
&sls::UdpRxSocket::ReceivePacket),
|
||||||
&s);
|
&s);
|
||||||
|
|
||||||
//s.Close(); Commented out by Dhanya (TODO!)
|
s.Shutdown();
|
||||||
auto r = ret.get();
|
auto r = ret.get();
|
||||||
|
|
||||||
CHECK(r == false); // since we didn't get the packet
|
CHECK(r == false); // since we didn't get the packet
|
||||||
|
Loading…
x
Reference in New Issue
Block a user