Skip to content

Commit

Permalink
fix: use hostname for serverUri
Browse files Browse the repository at this point in the history
  • Loading branch information
paulpach committed Oct 15, 2020
1 parent 78e2197 commit 4b38fbe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 1 addition & 3 deletions Assets/Mirror/Runtime/Transport/Kcp/KcpTransport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ public class KcpTransport : Transport
[Header("Transport Configuration")]
public ushort Port = 7777;

[SerializeField] private string _bindAddress = "localhost";

internal readonly Dictionary<IPEndPoint, KcpServerConnection> connectedClients = new Dictionary<IPEndPoint, KcpServerConnection>(new IPEndpointComparer());
readonly Channel<KcpServerConnection> acceptedConnections = Channel.CreateSingleConsumerUnbounded<KcpServerConnection>();

Expand Down Expand Up @@ -97,7 +95,7 @@ public override IEnumerable<Uri> ServerUri()
var builder = new UriBuilder
{
Scheme = "kcp",
Host = _bindAddress,
Host = Dns.GetHostName(),
Port = Port
};
return new[] { builder.Uri };
Expand Down
2 changes: 2 additions & 0 deletions Assets/Tests/Runtime/Transport/TransportTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
using Object = UnityEngine.Object;
using System.Linq;
using Cysharp.Threading.Tasks;
using Mirror.KCP;

namespace Mirror.Tests
{
[TestFixture(typeof(TcpTransport), new[] { "tcp4" }, "tcp4://localhost", 7777)]
[TestFixture(typeof(KcpTransport), new[] { "kcp" }, "kcp://localhost", 7777)]
public class AsyncTransportTests<T> where T : Transport
{
#region SetUp
Expand Down

0 comments on commit 4b38fbe

Please sign in to comment.