We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d8f967c commit 167555cCopy full SHA for 167555c
1 file changed
src/lib.rs
@@ -167,6 +167,7 @@ use rand::Rng;
167
168
use std::default::Default;
169
use std::net::ToSocketAddrs;
170
+use std::process::Command;
171
use std::sync::{Arc, Mutex, RwLock};
172
use std::time::{Duration, Instant, SystemTime, UNIX_EPOCH};
173
@@ -333,6 +334,16 @@ impl Node {
333
334
listeners.push(listener);
335
},
336
Err(e) => {
337
+ println!("Failed to bind to port {}", addr);
338
+
339
+ // On Linux/macOS
340
+ let output = Command::new("lsof")
341
+ .args(&["-i", &format!(":{}", &addr.port())])
342
+ .output()
343
+ .expect("failed to execute lsof");
344
345
+ println!("{}", String::from_utf8_lossy(&output.stdout));
346
347
log_error!(
348
logger,
349
"Failed to bind to {}: {} - is something else already listening?",
0 commit comments