[Question] This mod vs. JVM start args
OrdinatorStouff opened this issue ยท 1 comments
I was wondering if there is any notable difference from what this mod does versus starting the server and client with the system args passed to set timeout values?
Forge's Network Handler can have custom timeouts, simply adding -Dfml.readTimeout=90
to JVM launch args will define a 90-second read timeout over the default 30. The one "downside" to this however is that both server and clients must add the JVM arg or else whichever is the smaller value will end up "timing-out first." (Even if server is set to 90, if the client is not, then the client will time itsself out at 30 -- the inverse also being true if only applied to the client and not the server. Anecdotally, I believe your mod would need to be on both server and client to have full effect for this same reason).
I would agree that having a mod to download or even include by default in a modpack is easier to "distribute" than teaching unknowing people about JVM args and how to go about modifying them, multiplied by however many players a server might have. For that reason I feel like this mod has worth over the JVM arg method, but my question (sorry for the long-windedness) is how much of this mod's code/methods-of-action (eg asm) are actually necessary and can it be optimized by instead just setting a system property called "readTimeout" and "loginTimeout" early in launch with configured values that Forge will just pick up as the new value?
I'm not a developer so my understanding of the forge timeout stuff is strictly anecdotal, not technical. Also, I have no idea of the steps necessary to modify these timeouts from a mod/code standpoint and perhaps your code is as simplified as it can be, I just wanted to take the time to 1) ask if there's any benefit of this over JVM args and 2) ask/suggest if there's other ways in code to approach the same concept (i.e. possibly avoiding asm/coremod/whatever).
Setting readTimeout to 240 wasn't enough for my friend.
I found a Reddit post from a month ago that found two other classes where I'd have to patch the read and login timeouts. These classes seem to be server-sided, and someone else told me the mod worked server-side only, so I'm assuming that the mod is working even if it's only on the server.
I could probably add a config option to disable the ASM and just set the system properties though.