[SOLVED] import java.net.DatagramPacket;

$25

File Name: import_java.net.DatagramPacket;.zip
File Size: 292.02 KB

5/5 - (1 vote)

import java.net.DatagramPacket;
import edu.utulsa.unet.UDPSocket;
import java.net.DatagramSocket;
import java.net.InetAddress;

Copyright By Assignmentchef assignmentchef

public class udpsender {

public static void main(String[] args)
int localPort=Integer.parseInt(args[0]);
String serverName=args[1];
int serverPort=Integer.parseInt(args[2]);

byte [] buffer = (Hello World- or rather Mauricio saying hello through UDP).getBytes();
UDPSocket socket = new UDPSocket(localPort);
//DatagramSocket socket = new DatagramSocket(23456);
socket.send(new DatagramPacket(buffer, buffer.length,
InetAddress.getByName(serverName), serverPort));
catch(Exception e){ e.printStackTrace(); }

CS: assignmentchef QQ: 1823890830 Email: [email protected]

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] import java.net.DatagramPacket;
$25