When to close a UDP socket
问题 I have a client-server application that uses a UDP socket to send the data , the data only have to travel from client to server , and the server will always have the same IP. The only requirement is that I have to send messages about 10 messages per second Currently I am doing it the following way : public void SendData(byte[] packet) { IPEndPoint end_point = new IPEndPoint(serverIP, serverPort); UdpClient udpChannel = new UdpClient(sourcePort); udpChannel.Connect(end_point); udpChannel.Send