marzent / IINACT

A Dalamud plugin to run the FFXIV_ACT_Plugin in an ACT-like enviroment with a heavily modified port of Overlay Plugin
https://www.iinact.com
GNU General Public License v3.0
183 stars 42 forks source link

Modify Socket to use SO_REUSEADDR #47

Closed Zi-SH closed 1 year ago

Zi-SH commented 1 year ago

As discussed in the Discord, implementing SO_REUSEADDR on the socket will bind even if the previous instance is in a TIME_WAIT state. I've compiled and tested this in-game using LMeter:

2023-03-30 20:15:02.855 -04:00 [DBG] [OverlayPlugin.Core] Overlay WebSocket session with Id 214af227-cc20-4eb5-b46c-5da18d34acd2 disconnected! 2023-03-30 20:15:03.783 -04:00 [DBG] [OverlayPlugin.Core] Overlay WebSocket session with Id 32231e5e-818a-422f-9802-6f26839d6be2 connected! 2023-03-30 20:15:03.783 -04:00 [INF] [LMeter] Successfully Established ACT Connection 2023-03-30 20:15:04.603 -04:00 [DBG] [OverlayPlugin.Core] Overlay WebSocket session with Id 32231e5e-818a-422f-9802-6f26839d6be2 disconnected! 2023-03-30 20:15:05.432 -04:00 [DBG] [OverlayPlugin.Core] Overlay WebSocket session with Id 34f74200-80e4-492b-8367-67f243d5fa0c connected! 2023-03-30 20:15:05.433 -04:00 [INF] [LMeter] Successfully Established ACT Connection

I've also done the same test during combat and cannot find any issues.

It would be wise to have someone validated this on Windows and OSX as well to make sure it does not cause any issues.

marzent commented 1 year ago

Works well for me in a windows vm and macOS.

Thanks for this!