|
用网络抓包程序抓包,抓不到任何东西。
这个程序是不断发送UDP的java console程序
- import java.net.*;
- import java.io.*;
- public class UDPsender
- {
- public static void main(String arg[])
- {
- int count=0;
- try{
- while(true)
- {
- byte bffer[] ="hahahaha".getBytes();
- InetAddress address=InetAddress.getLocalHost(); //.getByName("www.zbvc.com");
- DatagramPacket data_pack = new DatagramPacket(bffer,bffer.length,address,80);
- DatagramSocket mail_data = new DatagramSocket();
- mail_data.send(data_pack);
- count++;
- System.out.println("NO."+count+" has send!");
- }
-
- }
- catch(IOException e){
- System.out.println("Error!");
- }
- }
- }
复制代码 |
|