mirror of
				https://github.com/edera-dev/krata.git
				synced 2025-11-04 07:39:39 +00:00 
			
		
		
		
	network: inter-container networking support
This commit is contained in:
		
							
								
								
									
										13
									
								
								network/examples/autonet.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								network/examples/autonet.rs
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,13 @@
 | 
			
		||||
use std::{thread::sleep, time::Duration};
 | 
			
		||||
 | 
			
		||||
use anyhow::Result;
 | 
			
		||||
use hyphanet::autonet::AutoNetworkCollector;
 | 
			
		||||
 | 
			
		||||
fn main() -> Result<()> {
 | 
			
		||||
    let mut collector = AutoNetworkCollector::new()?;
 | 
			
		||||
    loop {
 | 
			
		||||
        let changeset = collector.read_changes()?;
 | 
			
		||||
        println!("{:?}", changeset);
 | 
			
		||||
        sleep(Duration::from_secs(2));
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user