Open github-bdem opened 8 years ago
Have you verified that you actually have a process listening on that TCP port for Atom to connect to? (netstat -plnt | grep 39999
)
I will have to double check to see if any other process is running on there when I get home, however when grepping for 'Tabletop' none of the active ports for it were 39999.
I might have fixed that one error message in my local repo:
Uncaught TypeError: this.stopConnection is not a function
It won't fix the connection refused problem though. I'll take a look in my Ubuntu VM to see if I can reproduce this.
Edit: I can confirm that I'm getting this connection refused too on Linux. That's frustrating. Thanks for reporting.
'netstat -plnt | grep 39999' returns nothing. Checking 'lsof -i' as root (and normal user) I see
...
steam 6577 bdell 32u IPv4 637524 0t0 TCP localhost:57343 (LISTEN)
....
Tabletop 6838 bdell 9u IPv4 761152 0t0 UDP *:1715
Tabletop 6838 bdell 62u IPv4 664433 0t0 TCP localhost:48200->localhost:57343 (ESTABLISHED)
atom 8897 bdell 107u IPv4 768068 0t0 TCP localhost:39998 (LISTEN)
Which implies to me that Tabletop Simulator is not listening for anything (when played in sp mode) on the current linux build (since port 57343 appears to be a steam specific port as the listen server running on there has the same PID as the main steam process). Based on this info I think that this issue is up to the game devs to fix (not sure how else I can help but let me know).
Indeed, if port 39999 is the port that TTS is listening on for Atom connections, it appears not to be doing so in your case.
There is another (apparently random) port that TTS uses (1715 in my last post), however that port refuses connection as well.
Right now TTS fires up a thread that has a blocking TCPListener accepting TCPClients. It works fine on Windows but under Linux it's throwing a SocketException: Operation on non-blocking socket would block
which terminates the thread. I set the Socket inside of the TCPClient to be blocking so it's not making sense.
I'll probably have to contact Unity to figure this one out.
Sorry for the inconvenience of waiting.
Hello I was able to reproduce the:
SocketException: Operation on non-blocking socket would block
using Mono and the code posted here (I 'm assuming this forum question is from you guys) :
http://forum.unity3d.com/threads/linux-socketexception-operation-on-non-blocking-socket-would-block.399238/
I also couldn't find why AcceptTcpClient() was throwing the error, the best solution I thought of was create a new TcpListener class with a new AcceptTcpClient that checks if current OS is Unix, if is not procede as usual, if it is use BeginAcceptTcpClient and then ManualResetEvent to make it block:
class TcpListenerAsyncState {
public TcpListenerAsyncState(TcpListener listener) {
clientConnected = new System.Threading.ManualResetEvent (false);
this.listener = listener;
}
public System.Threading.ManualResetEvent clientConnected;
public TcpClient currentClient;
public TcpListener listener;
public static void AcceptTcpClientCallback(IAsyncResult ar) {
var state = (TcpListenerAsyncState) ar.AsyncState;
state.currentClient = state.listener.EndAcceptTcpClient (ar);
state.clientConnected.Set ();
}
}
class TcpListener : System.Net.Sockets.TcpListener {
public TcpListener (IPAddress localaddr, int port): base(localaddr, port){}
public TcpListener (IPEndPoint localEP) : base (localEP){}
public new TcpClient AcceptTcpClient() {
if (Environment.OSVersion.Platform != PlatformID.Unix) {
return base.AcceptTcpClient ();
}
var state = new TcpListenerAsyncState (this);
var callback = new AsyncCallback (TcpListenerAsyncState.AcceptTcpClientCallback);
BeginAcceptTcpClient (callback, state);
state.clientConnected.WaitOne ();
return state.currentClient;
}
}
It works fine under regular Mono, I don't know if Unity adds restrictions over what you can use in System.
Hope this helps.
Writing from 2017 I want to mention that this issue still persists, which really is a shame as I would absolutely love to script some games.
@tranek Have there been any changes to this lately?
Could no one figure this out?
Same problem.
Still a problem.
Preventing me from working on mods.
Please resolve this bug...
For those interested, this issue was apparently silently fixed at some point in the intervening time. I can't find a patch note for it, but TTS is listening on the port it supposed to on my Debian system and responds to messages.
Can you confirm it's working correctly, consistently? I tried to fix it last patch, but it hasn't been thoroughly tested.
On Fri, 11 Oct 2019, 20:37 Sam Heybey, notifications@github.com wrote:
For those interested, this issue was apparently silently fixed at some point in the intervening time. I can't find a patch note for it, but TTS is listening on the port it supposed to on my Debian system and responds to messages.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Berserk-Games/atom-tabletopsimulator-lua/issues/3?email_source=notifications&email_token=AEINQFOXNUXEKYMSCFKAPHLQODIXRA5CNFSM4CBNF2T2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBBAGCI#issuecomment-541197065, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEINQFJXODQKKVYI4ALWUTLQODIXRANCNFSM4CBNF2TQ .
TTS is consistently listening on its socket and both the official Atom extension and my Sublime plugin work as expected. I am running the latest Steam release build on Debian bullseye.
I haven't tested every bit of functionality, but I have tested "save and play" in Atom which connects to TTS to send messages. I will do more thorough testing as I work on my Sublime plugin.
That's good to hear, thank you!
On Fri, 11 Oct 2019, 23:33 Sam Heybey, notifications@github.com wrote:
TTS is consistently listening on its socket and both the official Atom extension and my Sublime plugin work as expected. I am running the latest Steam release build on Debian bullseye.
I haven't tested every bit of functionality, but I have tested "save and play" in Atom which connects to TTS to send messages. I will do more thorough testing as I work on my Sublime plugin.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Berserk-Games/atom-tabletopsimulator-lua/issues/3?email_source=notifications&email_token=AEINQFLXN6MASWNP3CVSMUDQOD5MDA5CNFSM4CBNF2T2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBBMCXI#issuecomment-541245789, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEINQFIG5Q32DH6JBQZZCOTQOD5MDANCNFSM4CBNF2TQ .
I'm confirm, "Save and Play" now works as expected.
Is Tabletop Simulator always listening for connections on 39999? If I boot it up and run netstat
, should I be able to see 39999 listed? I'm on Windows 10.
Ugh this is happening to me too. Similar behavior as this forum post where 39999 is up initially, then goes down randomly. I can even watch it in Resource Monitor. Atom plugin won't work as a result.
Uncommenting the console.log functions in 'lib/tabletopsimulator-lua.coffee' it looks like tabletop simulator isn't listening on the port specified there (39999).
Error: connect ECONNREFUSED 127.0.0.1:39999(…)
Possibly something to do with the linux build?
Atom Version: 1.7.2 System: Debian GNU/Linux Thrown From: tabletopsimulator-lua package, v1.1.3
Stack Trace
Uncaught TypeError: this.stopConnection is not a function
Commands
Config
Installed Packages
Console output