Multi-thread and UDP communication in C#
In my last project I also used the UDP system in c#. I have learned the course of computer network, but have never used c# or .NET(is UDP a part of .NET frame?) for programming. I know that UDP do not require a connection between the client and the server. It is more like a broadcast system, the client and the server can send message to each other, but they can not confirm that if the other side have received the message completely. But I have no idea about how to use it to convey messages in an instance of system. After a period of researching, I found that the basement of UDP in C# is multi-thread. Actually in my experience with unity and C#, I have never used the multi-thread system. At the most time, the coroutine and the function “Invoke” can fulfill most of my requirements. However, if I need to use UDP to receive message in C#, at least I need a while(true) loop in both the client and the server, to keep listening if there is an UDP message needs to be received...