Reddit-Mud / RMUD

A MUD written in C# using the fantastique literary genre, started by redditors.
MIT License
25 stars 8 forks source link

Keep-Alive? Also, 'quit' command? #81

Closed Trevoke closed 9 years ago

Trevoke commented 9 years ago

Right now I'm logged on three times to DevRW's server. I use tt++ as a client, which might have something to do with it (?) but .. Anyway, I had to close the client because it seemed like I couldn't send commands anymore.

So we need to handle clients not logging out properly. And maybe have a 'quit' command as well.

Blecki commented 9 years ago

I will try to reproduce. It might be that the server isn't noticing it's lost the connection unless it tries to send you something.

Blecki commented 9 years ago

The basic problem is that TCP is a passive protocol. If you never try to send data, it never notices there's a problem. We have to use TCP, and we can't implement a keep alive signal on top in a generic way since it will be up to the client to handle it properly. TCP does, however, have it's own keep alive mechanism. My client happens to turn this on so I never noticed. I guess yours does not. I was able to get one of your dupes to disconnect by talking to it - as soon as the server tried to send to it, the server detected the problem. I've turned the mechanism on on the server side. I don't know that it will work in mono. Anyway...

A) Accounts will allow us to prevent duplicates. You'll be able to reconnect to the same character. B) A heart beat event would stop the mud just sitting their idle so that dropped connections are detected faster.