accept() can return an error
This commit is contained in:
parent
8cd6eed238
commit
d1cd336ccd
1 changed files with 7 additions and 5 deletions
2
dc11.cpp
2
dc11.cpp
|
@ -117,6 +117,7 @@ void dc11::operator()()
|
|||
}
|
||||
|
||||
pfds[client_i].fd = accept(pfds[i].fd, nullptr, nullptr);
|
||||
if (pfds[client_i].fd != -1) {
|
||||
set_nodelay(pfds[client_i].fd);
|
||||
|
||||
std::unique_lock<std::mutex> lck(input_lock[i]);
|
||||
|
@ -125,6 +126,7 @@ void dc11::operator()()
|
|||
if (is_rx_interrupt_enabled(i))
|
||||
trigger_interrupt(i);
|
||||
}
|
||||
}
|
||||
|
||||
// receive data
|
||||
for(int i=dc11_n_lines; i<dc11_n_lines * 2; i++) {
|
||||
|
|
Loading…
Add table
Reference in a new issue