Welcome, Guest. Please login or register.
Did you miss your activation email?

News:
Precision Simulator update 10.132 (14 February 2021) is now available.
Aerowinx NG FMC and More is now released.

Author Topic: PSX Server redundancy?  (Read 1270 times)

Hardy Heinlin

  • Moderator
  • Join date: May 2009
  • Posts: 12234
    • Aerowinx
Re: PSX Server redundancy?
« Reply #20 on: Tue, 12 Jan 2021 15:50 »
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

  • Moderator
  • Join date: May 2009
  • Location: KTMB
  • Posts: 4148
  • Hoppie designs avionics equipment for airliners.
    • http://www.hoppie.nl/
Re: PSX Server redundancy?
« Reply #21 on: Tue, 12 Jan 2021 18:56 »
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

  • Moderator
  • Join date: May 2009
  • Posts: 12234
    • Aerowinx
Re: PSX Server redundancy?
« Reply #22 on: Sun, 14 Feb 2021 01:00 »
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