Fix binding to ephemeral ports

This commit is contained in:
Vudjun 2024-10-31 09:20:07 +00:00
parent 89e1f50a34
commit ab3c84f099
2 changed files with 10 additions and 2 deletions

View File

@ -256,6 +256,11 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy
{
_proxy.ReturnEphemeralPort(ProtocolType, (ushort)((IPEndPoint)LocalEndPoint).Port);
}
var asIPEndpoint = (IPEndPoint)localEP;
if (asIPEndpoint.Port == 0)
{
asIPEndpoint.Port = (ushort)_proxy.GetEphemeralPort(ProtocolType);
}
LocalEndPoint = (IPEndPoint)localEP;

View File

@ -50,9 +50,12 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator
public void Dispose()
{
_parent.NetworkClient.DisconnectNetwork();
if (_parent.NetworkClient != null)
{
_parent.NetworkClient.DisconnectNetwork();
_parent.NetworkClient.NetworkChange -= NetworkChanged;
_parent.NetworkClient.NetworkChange -= NetworkChanged;
}
}
private ResultCode NetworkErrorToResult(NetworkError error)