mirror of
				https://github.com/MindWorkAI/AI-Studio.git
				synced 2025-10-31 18:00:21 +00:00 
			
		
		
		
	Refactored networking code
This commit is contained in:
		
							parent
							
								
									23bd11f4db
								
							
						
					
					
						commit
						45f0ab234f
					
				| @ -1,3 +1,4 @@ | |||||||
| pub mod encryption; | pub mod encryption; | ||||||
| pub mod log; | pub mod log; | ||||||
| pub mod environment; | pub mod environment; | ||||||
|  | pub mod network; | ||||||
| @ -517,11 +517,6 @@ async fn dotnet_ready(_token: APIToken) { | |||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| fn get_available_port() -> Option<u16> { |  | ||||||
|     TcpListener::bind(("127.0.0.1", 0)) |  | ||||||
|         .map(|listener| listener.local_addr().unwrap().port()) |  | ||||||
|         .ok() |  | ||||||
| } |  | ||||||
| 
 | 
 | ||||||
| fn stop_servers() { | fn stop_servers() { | ||||||
|     if let Some(server_process) = DOTNET_SERVER.lock().unwrap().take() { |     if let Some(server_process) = DOTNET_SERVER.lock().unwrap().take() { | ||||||
|  | |||||||
							
								
								
									
										7
									
								
								runtime/src/network.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								runtime/src/network.rs
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,7 @@ | |||||||
|  | use std::net::TcpListener; | ||||||
|  | 
 | ||||||
|  | pub fn get_available_port() -> Option<u16> { | ||||||
|  |     TcpListener::bind(("127.0.0.1", 0)) | ||||||
|  |         .map(|listener| listener.local_addr().unwrap().port()) | ||||||
|  |         .ok() | ||||||
|  | } | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user