public class UDPServer {
public static void main(String[] args) throws Exception{
byte[] byt = new byte[1024];
DatagramPacket dp = new DatagramPacket(byt,byt.length);
DatagramSocket ds = new DatagramSocket(514);
while(true){
ds.receive(dp);
System.out.println("……");
System.out.println("server");
System.out.println("接收到:" + new String(byt,0,dp.getLength()).trim());
}
}
}
// 发送syslog 需要引入syslog4j-0.9.46.jar
/**
* SysLog发送数据
*
*
*/
public class SyslogTest2 {
public static