neolink icon indicating copy to clipboard operation
neolink copied to clipboard

Socket can't receive data in `discover_from_uuid_local`

Open vfdev-5 opened this issue 3 years ago • 1 comments

I'm using Argus 3 Pro and trying to get the stream from this camera using neolink built from source on MacOSX. Discovery globally fails with messages like in https://github.com/thirtythreeforty/neolink/issues/293

While debugging the code, I also see that socket somehow can't receive any data here: https://github.com/thirtythreeforty/neolink/blob/b6dd2e6c0dd6e9022a90b96b1bd14fc1198cb16e/crates/core/src/bc_protocol/connection/udpconn/discover.rs#L142

Using wireshark we can see that camera responded to UDP discovery packet Screen Shot 2022-09-18 at 22 30 42

I also tried to increase RX_TIMEOUT to more >30 seconds, but this does not help neither...

Any hints on what could be go wrong ? Thanks !

vfdev-5 avatar Sep 18 '22 20:09 vfdev-5

Hmm, do you have any firewalls (Little Snitch, etc) turned on?

thirtythreeforty avatar Sep 18 '22 21:09 thirtythreeforty

No, I do not think if there is a firewall turned on... Err part of socket.recv_from(&mut buf) gives message: "Resource temporarily unavailable". I'm also tweaking right now socket parameters ...

vfdev-5 avatar Sep 18 '22 21:09 vfdev-5

@thirtythreeforty you are right I have firewall enabled by default on macosx, disabling it I could connect to the camera. Thanks for the suggestion !

vfdev-5 avatar Sep 18 '22 22:09 vfdev-5

Glad you figured it out. I wonder if we can detect if the connection is firewalled. This would be os-specific though.

thirtythreeforty avatar Sep 18 '22 22:09 thirtythreeforty

Yes, this may be tricky. If local discovery connection is failed, we may put an extra message about firewall to the list of

Caused by:
    0: Connection error
    1: Timeout
    2: Maybe blocked by Firewall. Please check with disabled Firewall

vfdev-5 avatar Sep 18 '22 23:09 vfdev-5