I'm behind a NAT router that is really aggressive about kicking off idle connections, and I end up getting kicked off for inactivity every 10-20 minutes or so.
I'm aware that this can be solved via scripting (by sending an idle command), but I think this is a common enough problem that either a plugin should be provided as a download to users or the option included in the application. I don't think the user should be expected to code for this simple functionality. Also, such an application-level solution is inferior because it: a. makes idle timers inaccurate on MUCKs and b. makes it possible for the 'idle command' to mess up an edit in progress (that the user idled on).
Therefore, I think the best way is to use TCP keepalives. There was a discussion earlier on this board about them, but I think the objections some people raised were all very dated (being from the 80s). The proposed method would be to add an option in the world preferences, along with a text field for amount of time (in seconds) to wait between sending keepalive packets. The TCP keepalives can then be implemented with WSAIoctl(SIO_KEEPALIVE_VALS) when the sockets are opened.
I would contribute a patch, but I am basically inexperienced in Windows GUI programming. I barely managed to get MUCKClient compiled and even then it seemed to be off a bit (the toolbars were the wrong color). I also don't know how to go about adding the required UI elements.
However, I did "patch" this manually myself as an experiment. This involved the use of a disassembler and Microsoft Detours to hook into one of the methods in MUSHClient and making the call myself before returning control back to the main executable. It works very well with my connection, though as it stands, I have to find the offset for InitiateConnection with every MUSHClient revision, so it would be cool if this feature could make it in.
I'm aware that this can be solved via scripting (by sending an idle command), but I think this is a common enough problem that either a plugin should be provided as a download to users or the option included in the application. I don't think the user should be expected to code for this simple functionality. Also, such an application-level solution is inferior because it: a. makes idle timers inaccurate on MUCKs and b. makes it possible for the 'idle command' to mess up an edit in progress (that the user idled on).
Therefore, I think the best way is to use TCP keepalives. There was a discussion earlier on this board about them, but I think the objections some people raised were all very dated (being from the 80s). The proposed method would be to add an option in the world preferences, along with a text field for amount of time (in seconds) to wait between sending keepalive packets. The TCP keepalives can then be implemented with WSAIoctl(SIO_KEEPALIVE_VALS) when the sockets are opened.
I would contribute a patch, but I am basically inexperienced in Windows GUI programming. I barely managed to get MUCKClient compiled and even then it seemed to be off a bit (the toolbars were the wrong color). I also don't know how to go about adding the required UI elements.
However, I did "patch" this manually myself as an experiment. This involved the use of a disassembler and Microsoft Detours to hook into one of the methods in MUSHClient and making the call myself before returning control back to the main executable. It works very well with my connection, though as it stands, I have to find the offset for InitiateConnection with every MUSHClient revision, so it would be cool if this feature could make it in.