(&mut self, max_per_socket: usize, events: &mut Vec<NetworkEvent>)
| 281 | |
| 282 | fn poll_accepts(&mut self, max_per_socket: usize, events: &mut Vec<NetworkEvent>) { |
| 283 | let Some(host_ids) = self.tcp_hosts.live_ids() else { |
| 284 | return; |
| 285 | }; |
| 286 | for &host_index in host_ids.iter() { |
| 287 | let Some(host) = self.tcp_hosts.get(host_index) else { |
| 288 | continue; |
| 289 | }; |
| 290 | for _ in 0..max_per_socket { |
| 291 | match host.accept_event() { |
| 292 | Ok(Some((connection, event))) => { |
| 293 | let id = |
| 294 | TcpConnectionId(insert_slot(&mut self.tcp_connections, connection)); |
| 295 | events.push(NetworkEvent { |
| 296 | source: NetSource::TcpConnection(id), |
| 297 | event, |
| 298 | }); |
| 299 | } |
| 300 | Ok(None) => break, |
| 301 | Err(err) => { |
| 302 | events.push(net_error_event( |
| 303 | NetSource::TcpHost(TcpHostId(host_index)), |
| 304 | "tcp_accept", |
| 305 | err, |
| 306 | )); |
| 307 | break; |
| 308 | } |
| 309 | } |
| 310 | } |
| 311 | } |
| 312 | } |
| 313 |
no test coverage detected