Listens on 127.0.0.1:8000 and opens `source_peers` sockets from the computations we're examining.
(source_peers: usize)
| 193 | /// Listens on 127.0.0.1:8000 and opens `source_peers` sockets from |
| 194 | /// the computations we're examining. |
| 195 | fn open_sockets(source_peers: usize) -> Arc<Mutex<Vec<Option<TcpStream>>>> { |
| 196 | let listener = TcpListener::bind("127.0.0.1:8000").unwrap(); |
| 197 | let sockets = (0..source_peers) |
| 198 | .map(|_| Some(listener.incoming().next().unwrap().unwrap())) |
| 199 | .collect::<Vec<_>>(); |
| 200 | |
| 201 | Arc::new(Mutex::new(sockets)) |
| 202 | } |
| 203 | |
| 204 | /// Construct replayers that read data from sockets and can stream it |
| 205 | /// into timely dataflow. |