Hi there!
Thought i'd share my simple workaround on how to get an available port from the OS to start a Unet socket:
Workaround: how to get an available port to start a Unet host
Thought i'd share my simple workaround on how to get an available port from the OS to start a Unet socket:
Code (csharp):
- using System.Net;
- using System.Net.Sockets;
- using UnityEngine;
- using UnityEngine.Networking;
- using UnityEngine.Networking.Types;
- var address = IPAddress.Parse("0.0.0.0");
- IPEndPoint endpoint;
- using (var tempSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp)) {
- var...