News:

Precision Simulator update 10.173 (24 February 2024) is now available.
Navburo update 13 (23 November 2022) is now available.
NG FMC and More is released.

Main Menu

PSX Server redundancy?

Started by GodAtum, Sun, 3 Jan 2021 16:01

Hardy Heinlin

Quote from: Markus Vitzethum on Tue, 12 Jan 2021 14:51
https://aerowinx.com/board/index.php?topic=3629.msg61207#msg61207

In my situation the affected add-on was Externalsim.
However, I don't see Externalsim in Godatum's setup diagram (using WidePSX instead).

What can possibly go wrong that different external programs fall into a reconnect loop?

The question is, which instance causes the disconnection -- the PSX server or the add-on?

I can only tell what the PSX server does. The PSX server disconnects the client in any of the following cases:

• When PSX streams a message (always done by Java.io.PrintWriter.println) to the client and the following Java.io.PrintWriter.checkError is true. Note that "print" in this context doesn't refer to paper print but to a text in a buffer that streams into the network. I guess the buffer may get full when the client doesn't read the network messages. In that case, PSX assumes the client is dead and thus disconnects.

• When the user clicks the Disconnect button or Stop button etc.

• When the add-on sends "exit".

• When the buffered reader in PSX catches an i/o exception. Such errors are indicated in Aerowinx/Logs/errors.txt


The add-on may reconnect automatically. When the error reoccurs, it will be disconnected. And so on.


Regards,

|-|ardy

Jeroen Hoppenbrouwers

Quote from: Markus Vitzethum on Tue, 12 Jan 2021 14:51
What can possibly go wrong that different external programs fall into a reconnect loop?

Bad Ethernet, bad Wifi, router dropping TCP tables, annoying firewall.

Add-on code that breaks on something that PSX sends always on reconnect. This may be a particular value of some variable that the add-on cannot cope with, but that is rare to occur. Once PSX has this value, the add-on is doomed.

It's good practice for an add-on to have a brief (10 seconds) pause between connection retries. Not only to reduce the load on PSX and prevent running up the connection counter quickly, but also to allow a human to actually see the disconnect in some way. If the add-on goes on behind the scenes, nobody will ever notice what should be a rare event that indicates something went amiss.


Hoppie

Hardy Heinlin

PSX update 10.130 now shows a red message on Instructor > Network > Main when more than 1000 connections have been attempted. See item 130.10:

https://aerowinx.com/board/index.php?topic=4191.0


|-|ardy