saviobatista / 1090merge

Capture and merge data from multiple ADS-B basestations into a single file on a daily basis
https://hub.docker.com/r/saviobatista/1090merge
MIT License
2 stars 1 forks source link

Netcat is not effective at all #1

Open saviobatista opened 1 year ago

saviobatista commented 1 year ago

Using netcat (nc) has proven failed as when a connection drops this would kill a capture point and stop storing it.

One approach would be create a service that monitor and restart nc command, but this would be over work as there are way more effective ways to be effective in this matter as tcpdump, which is a great approach.

To be improved.

luciodaou commented 1 year ago

Suggestion is to use socat, seems more powerful than netcat: https://www.redhat.com/sysadmin/getting-started-socat

The command would then be: socat TCP-LISTEN:30003,reuseaddr,fork OPEN:adsb_log.csv,creat,append

luciodaou commented 1 year ago

Ncat version 7.93 is used on Fedora 38. Found out that using --recv-only allows for multiple listening and avoids the errors I was having with the logging through systemd.

From Ncat's man page/URL https://nmap.org/book/ncat-man.html :

       --recv-only (Only receive data)
           If this option is passed, Ncat will only receive data and will not try to send anything.
luciodaou commented 1 year ago

Using netcat (nc) has proven failed as when a connection drops this would kill a capture point and stop storing it.

Also from Ncat's documentation, there's a chapter regarding "Emulating Diagnostic Services | Ncat Users' Guide"