News:

Precision Simulator update 10.175 (29 May 2024) is now available.
Navburo update 13 (23 November 2022) is now available.
NG FMC and More is released.

Main Menu

Boost Server Stopping on Client Disconnect

Started by Gary Oliver, Sun, 4 Feb 2024 10:51

Gary Oliver

Hardy,

I have been working on several peoples simulators recently and find that when disconnecting a boost client the boost server can stop and not restart again.

I started off assuming it was something wrong with my clients but have confirmed that they are gracefully closing the socket connection.

It seems like there is some kind of race condition that causes the following error anywhere between the first disconnect and the third of a boost client and then the boost server needs starting manually again.

[Aerowinx Precision Simulator - Exceptions]

java.net.SocketException: Connection reset
at java.base/sun.nio.ch.NioSocketImpl.implRead(NioSocketImpl.java:313)
at java.base/sun.nio.ch.NioSocketImpl.read(NioSocketImpl.java:340)
at java.base/sun.nio.ch.NioSocketImpl$1.read(NioSocketImpl.java:789)
at java.base/java.net.Socket$SocketInputStream.read(Socket.java:1025)
at java.base/sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:333)
at java.base/sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:376)
at java.base/sun.nio.cs.StreamDecoder.lockedRead(StreamDecoder.java:219)
at java.base/sun.nio.cs.StreamDecoder.read(StreamDecoder.java:173)
at java.base/java.io.InputStreamReader.read(InputStreamReader.java:189)
at java.base/java.io.BufferedReader.fill(BufferedReader.java:161)
at java.base/java.io.BufferedReader.implReadLine(BufferedReader.java:371)
at java.base/java.io.BufferedReader.readLine(BufferedReader.java:348)
at java.base/java.io.BufferedReader.readLine(BufferedReader.java:437)
at NetServerThread.run(NetServerThread.java:210)

Please note I am using Windows OS'es (tested on 8 through to 11).

Any thoughts?

Cheers
G

Gary Oliver

Hardy,

It would appear when using system.sockets in c# calling a socket.shutdown() causes the issue.

If my app just calls a socket.Disconnect() on closure everything terminates gracefully without the exception.

Cheers
Goli

Hardy Heinlin

Does your add-on send the word "exit" and apply a little delay before it actually disconnects?


Regards,

|-|ardy

Gary Oliver

Hardy,

Oh!  In all the years of writing addons for PSX I have never noticed that section of the documentation!

I will rectify, however it doesn't seem to have caused any issues so far on the main server, however I do run Simstack switch in front of PSX Server which has probably protected it somewhat.

Cheers
G