diff --git a/src/lib/ebus/transport.cpp b/src/lib/ebus/transport.cpp index 60932ff61..fb40ede6d 100644 --- a/src/lib/ebus/transport.cpp +++ b/src/lib/ebus/transport.cpp @@ -328,13 +328,13 @@ result_t NetworkTransport::openInternal() { if (m_fd < 0) { return RESULT_ERR_GENERIC_IO; } - if (!m_udp) { - usleep(25000); // wait 25ms for potential initial garbage - } int cnt; symbol_t buf[MTU]; int ioerr; while ((ioerr=ioctl(m_fd, FIONREAD, &cnt)) >= 0 && cnt > 1) { + if (!m_udp) { + break; // no need to skip anything on a fresh TCP connection + } // skip buffered input ssize_t read = ::read(m_fd, &buf, MTU); if (read <= 0) {