Sorry, we don't support your browser.  Install a modern browser

External Editor TCP connection closes after every message: causes racing condition#1773

D

This might be a problem caused by my limited experience with TCP connections, but from what I can tell the TCP connection on port 39999 and 39998 gets closed by Tabletop Simulator after every message. This behaviour causes a racing condition when lua code is executed with a print statement and a return value.

The following message gets sent to the server:

{
    "messageID": 3,
    "guid":"-1",
    "script":"print(\"Hello, World\") \n return true",
    "returnID":"5"
}

Tabletop Simulator should return these messages as an answer:

{
    "messageID": 2,
    "message": "Hello, World"
}
{
    "messageID": 5,
    "returnValue": true
}

Since Tabletop Simulator only sends one message before it closes the TCP connection it is random which of these two messages gets recieved.

Further testing of this issue is required since this could also be a problem with Rusts TCP listener that I’m using.

2 years ago