Skip to content

Commit

Permalink
oops
Browse files Browse the repository at this point in the history
  • Loading branch information
mcm001 committed Sep 1, 2024
1 parent 8595a2e commit 3d870ab
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ntcore/src/main/native/cpp/net/TimeSyncClientServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ void wpi::TimeSyncServer::UdpCallback(uv::Buffer& data, size_t n,
const sockaddr& sender, unsigned flags) {
wpi::println("Hello from a ping!");

if (static_cast<size_t>(n) != data.len) {
WPI_ERROR(m_logger, "Didn't get right num bytes from client?");
return;
}
// if (static_cast<size_t>(n) != data.len) {
// WPI_ERROR(m_logger, "Didn't get right num bytes from client? Got {} != {}", n, data.len);
// return;
// }

TspPing ping{wpi::UnpackStruct<TspPing>(data.bytes())};

Expand Down Expand Up @@ -159,6 +159,7 @@ wpi::TimeSyncServer::TimeSyncServer(int port,

void wpi::TimeSyncServer::Start() {
m_udp->received.connect(&wpi::TimeSyncServer::UdpCallback, this);
m_udp->StartRecv();
}

void wpi::TimeSyncServer::Stop() {
Expand Down

0 comments on commit 3d870ab

Please sign in to comment.