using System; using UnityEngine; public class PolarListener : MonoBehaviour { private UdpConnection connection; private void Start() { string sendIp = "127.0.0.1"; int sendPort = 8881; int receivePort = 6789; connection = new UdpConnection(); connection.StartConnection(sendIp, sendPort, receivePort); } private void Update() { foreach (var message in connection.getMessages()) Debug.Log(message); connection.Send("Hi!"); } private void OnDestroy() { connection.Stop(); } }