diff --git a/Assets/UDPClient/UDPPrinter.cs b/Assets/UDPClient/UDPPrinter.cs index 29242be..f7daece 100644 --- a/Assets/UDPClient/UDPPrinter.cs +++ b/Assets/UDPClient/UDPPrinter.cs @@ -13,7 +13,7 @@ public class UDPPrinter : MonoBehaviour // Start is called before the first frame update void Start() { - udpUtil = new UDPUtility("127.0.0.1", 20000); + udpUtil = new UDPUtility("192.168.1.41", 20000); udpUtil.sendData("hello everyone!"); } @@ -22,9 +22,6 @@ public class UDPPrinter : MonoBehaviour { if (udpUtil != null && !"".Equals(udpUtil.getReceivedValue())) { - /*GameObject item = Instantiate(tcpMsgItem, tcpMsgContent); - item.GetComponentInChildren().text = tcpUtil.receivedData.Value; - this.GetModel().onDataRecived.Invoke(tcpUtil.receivedData.Value);*/ Debug.Log(udpUtil.receivedData.Value); } } diff --git a/Assets/UDPClient/UDPUtility.cs b/Assets/UDPClient/UDPUtility.cs index 3e37962..8188bf5 100644 --- a/Assets/UDPClient/UDPUtility.cs +++ b/Assets/UDPClient/UDPUtility.cs @@ -78,7 +78,7 @@ public class UDPUtility : IUtility public void RecciveMsg() { string msg = ""; - Debug.Log("StartReceiving!"); + //Debug.Log("StartReceiving!"); while (isOpenUDP.Value) { try @@ -98,7 +98,7 @@ public class UDPUtility : IUtility //断线发送异常 isTimeOut.Value = true; exceptionData.Value = e.ToString(); - break; + //break; } } Debug.Log("------------end While-------------");