finish web test api
This commit is contained in:
@@ -31,6 +31,28 @@ class UDPClientPool
|
||||
await Task.Run(() => { SendBytes(endPoint, buf); });
|
||||
}
|
||||
|
||||
public static void SendAddrPack(IPEndPoint endPoint, WebProtocol.SendAddrPackage pkg)
|
||||
{
|
||||
Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
|
||||
socket.SendTo(pkg.ToBytes(), endPoint);
|
||||
}
|
||||
|
||||
public async static void AsyncSendAddrPack(IPEndPoint endPoint, WebProtocol.SendAddrPackage pkg)
|
||||
{
|
||||
await Task.Run(() => { SendAddrPack(endPoint, pkg); });
|
||||
}
|
||||
|
||||
public static void SendDataPack(IPEndPoint endPoint, WebProtocol.SendDataPackage pkg)
|
||||
{
|
||||
Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
|
||||
socket.SendTo(pkg.ToBytes(), endPoint);
|
||||
}
|
||||
|
||||
public async static void AsyncSendDataPack(IPEndPoint endPoint, WebProtocol.SendDataPackage pkg)
|
||||
{
|
||||
await Task.Run(() => { SendDataPack(endPoint, pkg); });
|
||||
}
|
||||
|
||||
public static void SendLocalHost(int port, string[] stringArray)
|
||||
{
|
||||
Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
|
||||
|
||||
Reference in New Issue
Block a user