import java.io.*;
import java.net.*;
class Text{
public static void main(String[] args) throws IOException{
DatagramSocket ds = new DatagramSocket();
BufferedReader fr = new BufferedReader(new InputStreamReader(System.in));
String line;
while((line=fr.readLine())!=null)
{
//if("886".equals(line))
//break;
byte[] b = line.getBytes();/*这个时候b编译不过为什么。把if语句加上就可以编译。这是什么原因*/
}
DatagramPacket dp = new DatagramPacket(b,b.length,InetAddress.getByName("192.168.0.103"),10000);
ds.send(dp);
ds.close();
} |
|