[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Client-side NAT keepalive function?
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Client-side NAT keepalive function?

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by Linda   Sweden  (164 posts)  [Biography] bio
Date Wed 15 Mar 2006 08:48 PM (UTC)  quote  ]
Message
These days, a lot of people are stuck behind NAT routers with fixed timeouts that are hard or even impossible to change. Some games have implemented commands such as IDLE (penn) and KEEPALIVE (Tiny) that keep the connection alive without actually leading to any player activity (since many games also frown on people using scripts to keep themselves from not running into the game's idle limits). With these commands, the player stays idle but the connection deidles every x minutes to avoid being dropped by the router.

Apparently, this can also be done client-side, and I think this would be an excellent addition, since not all games have implemented this server-side.
[Go to top] top

Posted by Nick Gammon   Australia  (19,473 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Wed 15 Mar 2006 10:53 PM (UTC)  quote  ]
Message
What does the client send? It would have to send something to keep the router happy. Whatever it is, you could send it on a 1-minute timer, or something.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Linda   Sweden  (164 posts)  [Biography] bio
Date Reply #2 on Thu 16 Mar 2006 10:08 AM (UTC)  quote  ]
Message
When you use the idle/keepalive command built into the MUSH, then yes, you use a trigger to send the command at whatever interval you need.The key is that sending this command to the MUSH doesn't produce any activity as far as the MUSH is concerned.

To borrow the description from PennMUSH's helpfiles:

IDLE

This command does nothing. It does not reset a connection's idle time. It is useful for people who are connecting from behind a NAT gateway with a short fixed timeout; if you're in this situation, have your client send the IDLE command every minute or so, and the NAT connection won't time out (but you won't appear, to other players, to be active).

I am not entirely sure how this could be done client-side. :) Someone who is developing a new client for Mac told me she had just implemented a client-side keepalive function, instead of depending on the MUSH to have an idle/keepalive command, since it is not implemented by everyone yet.

[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Reply #3 on Thu 16 Mar 2006 10:18 AM (UTC)  quote  ]
Message
Seems that all you need to do is receive some input, and throw it away. But that implies that the server is sending you input, which isn't what you want.

Maybe you could send the server a zero byte? It would probably just throw it away in the string parsing, before it does idle checks etc.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Nick Gammon   Australia  (19,473 posts)  [Biography] bio   Forum Administrator
Date Reply #4 on Thu 16 Mar 2006 07:50 PM (UTC)  quote  ]
Message
It depends a bit on what the server would accept as "no input" but the router would take as "data".

If the server supports backspacing, maybe sending:

X<backspace>

would work.

In VBscript this would be something like:


Send "X" & chr (8)


If you make a timer and "send to script" that, every minute, it might work. However some servers expect clients to do backspacing. You could try however.

I tried this timer:


<timers>
  <timer enabled="y" 
         minute="1"    
         send_to="12"
>
  <send>
Send "X" &amp; chr (8)</send>
  </timer>
</timers>


However with SMAUG at least, it was not a big success, as I simply saw X followed by a little box on my screen. Evidently it did not handle backspaces.

Also, the "Send" function appends a carriage-return/linefeed so it was the same as sending a newline anyway.

Maybe just sending a blank line every 10 minutes or so would be acceptable to the MUD, and keep the connection alive. The MUD should probably be designed such that someone simply hitting <return> does not clear their AFK flag.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (19,473 posts)  [Biography] bio   Forum Administrator
Date Reply #5 on Thu 16 Mar 2006 07:51 PM (UTC)  quote  ]
Message
Quote:

Someone who is developing a new client for Mac told me she had just implemented a client-side keepalive function ...


Maybe ask her how it was done?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Linda   Sweden  (164 posts)  [Biography] bio
Date Reply #6 on Thu 16 Mar 2006 11:53 PM (UTC)  quote  ]
Message
I'll see if I can get an explanation of how she was planning to implement it. :)
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


4,118 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Web site powered by FutureQuest.Net]