Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/online2bin/online2-tcp-nnet3-decode-faster.cc
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ bool TcpServer::ReadChunk(size_t len) {
KALDI_WARN << "Socket timeout! Disconnecting...";
break;
}
if (client_set_[0].revents != POLLIN) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hhadian what do you think about this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems good to me. At least AFAIK revents is a bit mask and should not be compared like this (e.g. other bits in addition to POLLIN might be set). Maybe it's better to keep this if-block too but like this: if (!(client_set_[0].revents & POLLIN)).
Babak, can you please see if this will work too in your tests?
Anyway more checks might be needed, I don't remember all details right now (see http://man7.org/linux/man-pages/man2/poll.2.html)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hhadian Yes it works too.

if (poll_ret < 0) {
KALDI_WARN << "Socket error! Disconnecting...";
break;
}
Expand Down