1.原理及概述
基于Udp协议是无连接模式通讯,占用资源少,响应速度快,延时低。至于可靠性,可通过应用层的控制来满足。(不可靠连接)(1).建立一个套接字(Socket)
(2).绑定服务器端IP地址及端口号--服务器端
(3).通过SendTo()方法向指定主机发送消息 (需提供主机IP地址及端口)
(4).通过ReciveFrom()方法接收指定主机发送的消息 (需提供主机IP地址及端口)
2.服务器端
2.1 Program.CS
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.