Tarmslitaren / FrosthavenAssistant

flutter app
GNU Affero General Public License v3.0
184 stars 45 forks source link

Fixed Issue with Remote Clients Behind NAT #176

Closed AshleyRitaS closed 1 year ago

AshleyRitaS commented 1 year ago

Original Issue: When multiple client applications are running on the same network and sharing the same external IP address, only 1 could be connected at any one time. As soon as a second client attempted to connect, the first client would be immediately disconnected. (This is a rare use case, but can occur with remote play).

Resolution: When adding a new connection, the application first checks for duplicate connections and closes them. This duplicate connection check only compared remote IP addresses, meaning it gave false positives for multiple clients behind common NAT configurations. This fix changes the duplicate check to confirm that both the IP address and remote port are the same before closing the connection.

NOTE: I have only been able to test this change on Windows devices, though it should be platform agnostic.

Tarmslitaren commented 1 year ago

thanks!