TheGrandmother / MUD

The worlds lames mud :/
1 stars 1 forks source link

Connections never timeout #21

Closed TheGrandmother closed 8 years ago

TheGrandmother commented 8 years ago

Clients never gets removed or timedout. I logged in a bunch of users like 30 minutes ago and they are still active :/

Chilinot commented 8 years ago

If you dont close their connection to their server they will not timeout.

Chilinot commented 8 years ago

How was the test performed?

Chilinot commented 8 years ago

I added a statement to the server that manually closes the connection when a LOGOUT message is received. commit a4c5d538fa3178ba492f7c40ead87f513a5d1c5e

TheGrandmother commented 8 years ago

I just logged in with a bunch of different users rough the browser interface to test the say action.

What I did was I just reloaded the page to log in a new user which should have terminated the previous connection.

Chilinot commented 8 years ago

Are you sure the server was running the latest version at the time with the memory leak and logout fix?

TheGrandmother commented 8 years ago

The client does not send a logout when it is closed. Shouldn't the heart beats automatically close the connection after a timeout

Chilinot commented 8 years ago

There are no heartbeats any more.

TheGrandmother commented 8 years ago

Yes I was using the latest version.

TheGrandmother commented 8 years ago

Why has the heart stopped beating?

The server would have to automatically send the logout message to the game engine. It can't be done reliably on the browser side.

Chilinot commented 8 years ago

Then i need to look into how the websocket library handles disconnects and whether or not it timesout the connection. It might be that it considers your page reload to be the same connection and never terminate it.

TheGrandmother commented 8 years ago

I think there is a keep alive option for websocket connections which might fuck up

Chilinot commented 8 years ago

Looking at the source of the library, it seems to close the connection when it finds EOT (possibly end of transmission, there are no comments or documentation to explain it) or when it receives an closing handshake from the other side.

TheGrandmother commented 8 years ago

Then we need to re implement heart beats. It's impossible to send a logout message if the browser shuts down unexpectedly.

TheGrandmother commented 8 years ago

Solved by 05c1d74e955124912a8d092b267add0ac26c3abb