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