Skip to content

Instantly share code, notes, and snippets.

Created Aug 14, 2016
Embed
What would you like to do?
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.Inet4Address;
import java.net.InetAddress;
public class Network {
public void sendPacket(final byte[] d) {
DatagramSocket socket = new DatagramSocket(null);
socket.setReuseAddress(true);
socket.setBroadcast(true);
DatagramPacket dp = new DatagramPacket(d, d.length, InetAddress.getByName("192.168.1.255"), 56700);
socket.send(dp);
}
}
network.sendPacket(Hex.decodeHex(
"24000034666a7e0100000000000000000000000000000100000000000000000002000000".toCharArray())
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment