参见TCP协议,差别在在这里
FileSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Udp);//UDP
FileSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);//Tcp
送上小例子一份,自己修改成UDP的!!我这个是发送List集合的例子哈!!