mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-11 22:28:26 +00:00
Refactored runtime (#192)
This commit is contained in:
1 parent
58d7478f3a
commit
d0a366258a
13 files changed
+1254
-1050
No files matched your search
@@ -0,0 +1,8 @@
|
||||
use std::net::TcpListener;
|
||||
|
||||
/// Returns an available port on the local machine.
|
||||
pub fn get_available_port() -> Option<u16> {
|
||||
TcpListener::bind(("127.0.0.1", 0))
|
||||
.map(|listener| listener.local_addr().unwrap().port())
|
||||
.ok()
|
||||
}
|
||||
Reference in new issue
Block a user