Reconnect if disconnected

Post Reply
theyaggie
Posts: 3
Joined: Sat Apr 04, 2020 4:41 am

Reconnect if disconnected

Post by theyaggie »

So often if I leave Mudlet active during the night I will notice in the morning that it has disconnected:

[ ALERT ] - Socket got disconnected.
Reason: Unknown error

I am not interested about whether it's some router issue but I want to know is there a simple way to do reconnect when that message is printed? As in most cases I am not losing internet connection when this disconnect happens. I do have "Reconnect automatically" selected in profile but it does not seem to work as if I simply choose disconnect from menu and it doesn't reconnect. I also tried to do trigger which runs that first row and then calls alias which calls myfunction which calls reconnect() but that did not work so I guess normal triggers do not run those [ ALERT ] rows.

User avatar
Vadi
Posts: 4833
Joined: Sat Mar 14, 2009 3:13 pm

Re: Reconnect if disconnected

Post by Vadi »

> I do have "Reconnect automatically" selected in profile but it does not seem to work as if I simply choose disconnect from menu and it doesn't reconnect

That's intended - otherwise you'd never be able to disconnect. It is supposed to reconnect you in the case that your router shuts off the connection, though!

theyaggie
Posts: 3
Joined: Sat Apr 04, 2020 4:41 am

Re: Reconnect if disconnected

Post by theyaggie »

I play Zombiemud which reboots its server in every 24 hours. Connection is then closed by

[ ALERT ] - Socket got disconnected.
Reason: The remote host closed the connection

But "reconnect automatically" does not work in that case either. I wonder why? Is there anything I can check?

atari2600tim
Posts: 3
Joined: Sun Apr 05, 2020 4:39 am

Re: Reconnect if disconnected

Post by atari2600tim »

theyaggie wrote:
Sat Apr 04, 2020 7:42 pm
I play Zombiemud which reboots its server in every 24 hours. Connection is then closed by

[ ALERT ] - Socket got disconnected.
Reason: The remote host closed the connection

But "reconnect automatically" does not work in that case either. I wonder why? Is there anything I can check?
I think the reconnect checkbox will only reconnect when it suddenly discovers that it is not getting a response from the server.

But if the server sent you some bits indicating that closing the connection was intentional (because you had typed 'quit', or because the game is shutting down), then it does not try to reconnect.

Since you're getting "The remote host closed the connection", that sounds like your client didn't just stop hearing from the server, but was given those goodbye bits.

Someone on the Discord asked this same question a few weeks ago, and this thread sounds like it helped them: viewtopic.php?t=22448

theyaggie
Posts: 3
Joined: Sat Apr 04, 2020 4:41 am

Re: Reconnect if disconnected

Post by theyaggie »

atari2600tim wrote:
Sun Apr 05, 2020 5:18 am
I think the reconnect checkbox will only reconnect when it suddenly discovers that it is not getting a response from the server.

But if the server sent you some bits indicating that closing the connection was intentional (because you had typed 'quit', or because the game is shutting down), then it does not try to reconnect.

Since you're getting "The remote host closed the connection", that sounds like your client didn't just stop hearing from the server, but was given those goodbye bits.

Someone on the Discord asked this same question a few weeks ago, and this thread sounds like it helped them: viewtopic.php?t=22448
Thank you! Managed to get automatic reconnect to work by using that link's example :)

Post Reply