LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1144|回复: 1

这个程序为什么抓不到发送的包?

[复制链接]
发表于 2007-4-13 11:29:56 | 显示全部楼层 |阅读模式
用网络抓包程序抓包,抓不到任何东西。
这个程序是不断发送UDP的java console程序


  1. import java.net.*;
  2. import java.io.*;
  3. public class UDPsender
  4. {
  5. public static void main(String arg[])
  6.         {
  7.                 int count=0;
  8.          try{
  9.                  while(true)
  10.                  {
  11.          byte bffer[] ="hahahaha".getBytes();
  12.          InetAddress address=InetAddress.getLocalHost();  //.getByName("www.zbvc.com");       
  13.      DatagramPacket data_pack = new DatagramPacket(bffer,bffer.length,address,80);
  14.      DatagramSocket mail_data = new DatagramSocket();
  15.      mail_data.send(data_pack);
  16.      count++;
  17.      System.out.println("NO."+count+" has send!");
  18.                  }
  19.          
  20.          }
  21.       catch(IOException e){
  22.               System.out.println("Error!");
  23.               }     
  24.                  }

  25. }
复制代码
 楼主| 发表于 2007-4-29 20:55:03 | 显示全部楼层
为什么啊?再次顶上去!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表