Professional Documents
Culture Documents
*;
and output through data streams, serialization and the file system.
import java.net.*;//Provides
DataInputStream in=new DataInputStream(System.in);//receive the data from the system InetAddress ipa=InetAddress.getByName("192.168.2.31"); //represents the ip address byte[] sdata=new byte[1024]; //array for send packet data byte[] rdata=new byte[1024];//array for received packet data se=in.readLine(); sdata=se.getBytes(); System.out.println("vi micro"+se); DatagramPacket spack=new DatagramPacket(sdata,sdata.length,ipa,9876); s.send(spack);
DatagramPacket(rdata,rdata.length);