``` Port::Message message; bool useTimeout = flags & B_TIMEOUT; status_t status = port->Read(message, useTimeout ? timeout : B_INFINITE_TIMEOUT); ``` https://github.com/trungnt2910/hyclone/blob/44659c5f1643b5b3113dbb89a3ad7f72254ce720/hyclone_server/port.cpp#L573 ``` const auto readableOrDead = [&]() { return !_registered || _info.queue_count > 0; }; if (timeout != B_INFINITE_TIMEOUT) { _readCondVar.wait_for(lock, std::chrono::microseconds(timeout), readableOrDead); return; } ``` https://github.com/trungnt2910/hyclone/blob/44659c5f1643b5b3113dbb89a3ad7f72254ce720/hyclone_server/port.cpp#L99