Add public prop for setting IP+port simultaneously

This commit is contained in:
YoshiRulz 2020-07-26 04:34:06 +10:00
parent 6acf4ae6fb
commit b7eb90f990
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
1 changed files with 11 additions and 2 deletions

View File

@ -37,6 +37,16 @@ namespace BizHawk.Client.Common
}
}
public (string HostIP, int Port) TargetAddress
{
get => _targetAddr;
set
{
_targetAddr = value;
Connect();
}
}
#if true
private const int Retries = 10;
#else
@ -48,8 +58,7 @@ namespace BizHawk.Client.Common
public SocketServer(Func<byte[]> takeScreenshotCallback, string ip, int port)
{
_takeScreenshotCallback = takeScreenshotCallback;
_targetAddr = (ip, port);
Connect();
TargetAddress = (ip, port);
}
private void Connect()