-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathudpsender.java
More file actions
30 lines (27 loc) · 846 Bytes
/
Copy pathudpsender.java
File metadata and controls
30 lines (27 loc) · 846 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
https://powcoder.com
代写代考加微信 powcoder
Assignment Project Exam Help
Add WeChat powcoder
https://powcoder.com
代写代考加微信 powcoder
Assignment Project Exam Help
Add WeChat powcoder
import java.net.DatagramPacket;
import edu.utulsa.unet.UDPSocket;
//import java.net.DatagramSocket;
import java.net.InetAddress;
public class udpsender {
static final String SERVER = "linux1.ens.utulsa.edu";
static final int PORT = 32456;
public static void main(String[] args)
{
try {
byte [] buffer = ("Hello World- or rather Mauricio saying hello through UDP").getBytes();
UDPSocket socket = new UDPSocket(23456);
//DatagramSocket socket = new DatagramSocket(23456);
socket.send(new DatagramPacket(buffer, buffer.length,
InetAddress.getByName(SERVER), PORT));
}
catch(Exception e){ e.printStackTrace(); }
}
}