Skip to content

Commit

Permalink
perf: use Unitask
Browse files Browse the repository at this point in the history
  • Loading branch information
paulpach committed Oct 15, 2020
1 parent d210980 commit 384d02b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Assets/Mirror/Components/HeadlessAutoStart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ void Start()
// some transports might not be ready until Start.
if (server && SystemInfo.graphicsDeviceType == GraphicsDeviceType.Null && startOnHeadless)
{
_ = server.ListenAsync();
server.ListenAsync().Forget();
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion Assets/Mirror/Runtime/NetworkServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Cysharp.Threading.Tasks;
using Mirror.RemoteCalls;
using UnityEngine;
using UnityEngine.Events;
Expand Down Expand Up @@ -180,7 +181,7 @@ internal void RegisterMessageHandlers(INetworkConnection connection)
/// </summary>
/// <param name="maxConns">Maximum number of allowed connections</param>
/// <returns></returns>
public async Task ListenAsync()
public async UniTask ListenAsync()
{
Initialize();

Expand Down

0 comments on commit 384d02b

Please sign in to comment.