Skip to content

Commit

Permalink
Make timeout duration an optional argument
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Winther Moen committed Nov 26, 2024
1 parent 048d0dd commit 23c2069
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sdks/unity/AgonesSdk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,11 @@ private void OnApplicationQuit()
/// Async method that waits to connect to the SDK Server. Will timeout
/// and return false after 30 seconds.
/// </summary>
/// <param name="timeoutSeconds">The number of seconds to wait before timing out. Defaults to 30 seconds.</param>
/// <returns>A task that indicated whether it was successful or not</returns>
public async Task<bool> Connect()
public async Task<bool> Connect(int timeoutSeconds = 30)
{
for (var i = 0; i < 30; i++)
for (var i = 0; i < timeoutSeconds; i++)
{
Log($"Attempting to connect...{i + 1}");
try
Expand Down

0 comments on commit 23c2069

Please sign in to comment.