Zoxc / crusader

A network bandwidth and latency tester.
Apache License 2.0
95 stars 8 forks source link

Warn if no server running #7

Open richb-hanover opened 1 year ago

richb-hanover commented 1 year ago

I got the following error message when I ran the client without a server running at the other end.

A simple "No server seems to be running at \" would suffice

?134 release % ./crusader test 192.168.253.128
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 61, kind: ConnectionRefused, message: "Connection refused" }', crusader-lib/src/test.rs:1304:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
zsh: abort      ./crusader test 192.168.253.128
mcuee commented 3 months ago

I agree that this will be a good improvement.

PS C:\work\speedtest\crusader\src\target\release> .\crusader test 192.168.50.12
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 10061, kind: ConnectionRefused, message: "No connection could be made because the target machine actively refused it." }', crusader-lib\src\test.rs:1318:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

PS C:\work\speedtest\crusader\src\target\release> $Env:RUST_BACKTRACE="full"
PS C:\work\speedtest\crusader\src\target\release> .\crusader test 192.168.50.12
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 10061, kind: ConnectionRefused, message: "No connection could be made because the target machine actively refused it." }', crusader-lib\src\test.rs:1318:10
stack backtrace:
   0:     0x7ff729f35f32 - <unknown>
   1:     0x7ff729f51d7b - <unknown>
   2:     0x7ff729f3202a - <unknown>
   3:     0x7ff729f35c7b - <unknown>
   4:     0x7ff729f38289 - <unknown>
   5:     0x7ff729f37f0b - <unknown>
   6:     0x7ff729f389b8 - <unknown>
   7:     0x7ff729f388ae - <unknown>
   8:     0x7ff729f36919 - <unknown>
   9:     0x7ff729f38560 - <unknown>
  10:     0x7ff729f67195 - <unknown>
  11:     0x7ff729f676b6 - <unknown>
  12:     0x7ff729df0440 - <unknown>
  13:     0x7ff729d6895d - <unknown>
  14:     0x7ff729d6e456 - <unknown>
  15:     0x7ff729d6d2fc - <unknown>
  16:     0x7ff729f2cb7e - <unknown>
  17:     0x7ff729d6c7ac - <unknown>

PS C:\work\speedtest\crusader\src\target\debug> .\crusader test 192.168.50.12
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 10061, kind: ConnectionRefused, message: "No connection could be made because the target machine actively refused it." }', crusader-lib\src\test.rs:1318:10
stack backtrace:
   0:     0x7ff7fe84fa22 - std::backtrace_rs::backtrace::dbghelp::trace
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library\std\src\..\..\backtrace\src\backtrace\dbghelp.rs:98
   1:     0x7ff7fe84fa22 - std::backtrace_rs::backtrace::trace_unsynchronized
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library\std\src\..\..\backtrace\src\backtrace\mod.rs:66
   2:     0x7ff7fe84fa22 - std::sys_common::backtrace::_print_fmt
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library\std\src\sys_common\backtrace.rs:65
   3:     0x7ff7fe84fa22 - std::sys_common::backtrace::_print::impl$0::fmt
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library\std\src\sys_common\backtrace.rs:44
   4:     0x7ff7fe86bddb - core::fmt::write
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library\core\src\fmt\mod.rs:1232
   5:     0x7ff7fe84b85a - std::io::Write::write_fmt<std::sys::windows::stdio::Stderr>
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library\std\src\io\mod.rs:1684
   6:     0x7ff7fe84f76b - std::sys_common::backtrace::_print
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library\std\src\sys_common\backtrace.rs:47
   7:     0x7ff7fe84f76b - std::sys_common::backtrace::print
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library\std\src\sys_common\backtrace.rs:34
   8:     0x7ff7fe851d79 - std::panicking::default_hook::closure$1
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library\std\src\panicking.rs:271
   9:     0x7ff7fe8519fb - std::panicking::default_hook
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library\std\src\panicking.rs:290
  10:     0x7ff7fe8524a8 - std::panicking::rust_panic_with_hook
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library\std\src\panicking.rs:692
  11:     0x7ff7fe85239e - std::panicking::begin_panic_handler::closure$0
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library\std\src\panicking.rs:583
  12:     0x7ff7fe850409 - std::sys_common::backtrace::__rust_end_short_backtrace<std::panicking::begin_panic_handler::closure_env$0,never$>
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library\std\src\sys_common\backtrace.rs:150
  13:     0x7ff7fe852050 - std::panicking::begin_panic_handler
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library\std\src\panicking.rs:579
  14:     0x7ff7fe877705 - core::panicking::panic_fmt
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library\core\src\panicking.rs:64
  15:     0x7ff7fe877c26 - core::result::unwrap_failed
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library\core\src\result.rs:1750
  16:     0x7ff7fe31d2af - enum2$<core::result::Result<crusader_lib::file_format::RawResult,alloc::boxed::Box<dyn$<core::error::Error>,alloc::alloc::Global> > >::unwrap<crusader_lib::file_format::RawResult,alloc::boxed::Box<dyn$<core::error::Error>,alloc::alloc::Global> >
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc\library\core\src\result.rs:1090
  17:     0x7ff7fe31595a - crusader_lib::test::test
                               at C:\work\speedtest\crusader\src\crusader-lib\src\test.rs:1316
  18:     0x7ff7fe1a3fbd - crusader::main
                               at C:\work\speedtest\crusader\src\crusader\src\main.rs:120
  19:     0x7ff7fe1af62b - core::ops::function::FnOnce::call_once<void (*)(),tuple$<> >
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc\library\core\src\ops\function.rs:250
  20:     0x7ff7fe1ab53e - std::sys_common::backtrace::__rust_begin_short_backtrace<void (*)(),tuple$<> >
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc\library\std\src\sys_common\backtrace.rs:134
  21:     0x7ff7fe1ab53e - std::sys_common::backtrace::__rust_begin_short_backtrace<void (*)(),tuple$<> >
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc\library\std\src\sys_common\backtrace.rs:134
  22:     0x7ff7fe1a71c1 - std::rt::lang_start::closure$0<tuple$<> >
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc\library\std\src\rt.rs:166
  23:     0x7ff7fe84635e - core::ops::function::impls::impl$2::call_once
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library\core\src\ops\function.rs:287
  24:     0x7ff7fe84635e - std::panicking::try::do_call
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library\std\src\panicking.rs:487
  25:     0x7ff7fe84635e - std::panicking::try
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library\std\src\panicking.rs:451
  26:     0x7ff7fe84635e - std::panic::catch_unwind
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library\std\src\panic.rs:140
  27:     0x7ff7fe84635e - std::rt::lang_start_internal::closure$2
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library\std\src\rt.rs:148
  28:     0x7ff7fe84635e - std::panicking::try::do_call
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library\std\src\panicking.rs:487
  29:     0x7ff7fe84635e - std::panicking::try
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library\std\src\panicking.rs:451
  30:     0x7ff7fe84635e - std::panic::catch_unwind
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library\std\src\panic.rs:140
  31:     0x7ff7fe84635e - std::rt::lang_start_internal
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library\std\src\rt.rs:148
  32:     0x7ff7fe1a719a - std::rt::lang_start<tuple$<> >
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc\library\std\src\rt.rs:165
  33:     0x7ff7fe1a6fb9 - main
  34:     0x7ff7fe875650 - invoke_main
                               at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78
  35:     0x7ff7fe875650 - __scrt_common_main_seh
                               at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
  36:     0x7ffa67cb257d - BaseThreadInitThunk
  37:     0x7ffa698aaa58 - RtlUserThreadStart