Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,23 @@ public sealed class TCPCommunicationLayer : CommunicationLayer
[Range(1024, 65353)] [Tooltip("The out port to communicate on")]
public int outPort = 5556;

/// <summary>
/// How long the client keeps trying to reach the engine before giving up, in milliseconds
/// </summary>
/// <remarks>
/// This was previously hardcoded to <see cref="int.MaxValue" />, i.e. roughly 24 days of
/// retrying. If the engine process is already gone the connect loop therefore never
/// terminates, and because a Unity domain reload has to tear the client down, the reload
/// blocks on it - the editor hangs on "Reloading Domain (busy for ...)" indefinitely
/// rather than reporting a failed connection.
/// </remarks>
[Range(1000, 600000)] [Tooltip("Give up connecting to the engine after this long (ms)")]
public int connectionTimeout = 30000;
Comment on lines +41 to +42

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The connectionTimeout property already exists in the base CommunicationLayer class and causes this error to show in editor logs.

Image

Since I plan for the next release to be a 3.x breaking release anyway, the already marked Obsolete connectionTimeout property in the base CommunicationLayer class can be removed.

The serialized TCPCommunicationLayer asset included in the project will also need to be updated as it has the old 7000 timeout set from the base.

Image


public override Client CreateClient()
{
IPEndPoint ipEndPoint = new(IPAddress.Loopback, inPort);
return new TCPClient(ipEndPoint, int.MaxValue);
return new TCPClient(ipEndPoint, connectionTimeout);
}

public override Host CreateHost()
Expand Down