g4klx / NXDNClients

A gateway and a parrot for NXDN.
GNU General Public License v2.0
43 stars 149 forks source link

Re-open UDP socket on ENOTSOCK error. #127

Closed f1rmb closed 3 years ago

f1rmb commented 3 years ago

Avoids to fill up the log with error 88. Just like in the pending YSFClients PR.

g4klx commented 3 years ago

Why does this error occur? I have never seen it in any of my systems. I think you should look at your system and find out why you are getting it.

f1rmb commented 3 years ago

Why is it happening ? Let's say the server restarted or went to maintenance, maybe.

I had the same problem with YSFGateway with FCS Network (I raised the same PR few weeks back).

The major problem about this is, recvfrom() error returned code is never handled by the code, and the socket is still used regardless of its status (in this case it looks closed).

What I observed with the FCS Network (this specific NXDN was happening on a system run by a friend), is, it was working nicely, and suddenly, one night (around 00h00 here), the error 88 got triggered, every nights.

Anyway, even if you ignore this problem, I could run a patched version (it's just a 5 lines patch).

Best ... Daniel

f1rmb commented 3 years ago

I forgot to mention:

I'm running a Pi-Star fork, which use the latest version of all your software, this is why, maybe, you didn't get any reports on such platform yet, as the official version is running really old version (NDXNGateway and YSFGateway are 6 months old, MMDVMHost is 5).