From 8a190bfd176f043322097e64bd041e80e38cc6d2 Mon Sep 17 00:00:00 2001 From: vis2k Date: Tue, 25 Jun 2019 10:34:12 +0200 Subject: [PATCH] fix: TelepathyTransport.ToString UWP exception --- Assets/Mirror/Runtime/Transport/TelepathyTransport.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Assets/Mirror/Runtime/Transport/TelepathyTransport.cs b/Assets/Mirror/Runtime/Transport/TelepathyTransport.cs index d336246d8..fa1ed22e0 100644 --- a/Assets/Mirror/Runtime/Transport/TelepathyTransport.cs +++ b/Assets/Mirror/Runtime/Transport/TelepathyTransport.cs @@ -146,7 +146,15 @@ public override string ToString() { if (server.Active && server.listener != null) { - return "Telepathy Server port: " + server.listener.LocalEndpoint; + // printing server.listener.LocalEndpoint causes an Exception + // in UWP + Unity 2019: + // Exception thrown at 0x00007FF9755DA388 in UWF.exe: + // Microsoft C++ exception: Il2CppExceptionWrapper at memory + // location 0x000000E15A0FCDD0. SocketException: An address + // incompatible with the requested protocol was used at + // System.Net.Sockets.Socket.get_LocalEndPoint () + // so let's use the regular port instead. + return "Telepathy Server port: " + port; } else if (client.Connecting || client.Connected) {