import java.net.*;
public class Server {
public static void main(String[] args) throws Exception{
DatagramSocket server=new DatagramSocket(4160);
byte[] buf=new byte[256];
DatagramPacket p=new DatagramPacket(buf,buf.length);
server.receive(p);
String res=new String(p.getData());
System.out.println("R Data :"+res);
}
}
import java.net.*;
public class Client{
public static void main(String[] args) throws Exception{
DatagramSocket client=new DatagramSocket();
InetAddress add=InetAddress.getByName("localhost");
String str="Sharkz Reigns";
byte[] buf=str.getBytes();
DatagramPacket p=new DatagramPacket(buf,buf.length,add,4160);
client.send(p);
}
}
-
Notifications
You must be signed in to change notification settings - Fork 3
SHARKZTECH/csc322Java
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description or website provided.
Topics
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published