Created
January 31, 2017 13:27
-
-
Save hamanishi/196c79fe1b3092e943ea71ccea4ab7b8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hypermedia.net.*; | |
static final String IP = "239.255.42.99"; | |
static final int PORT = 1510; | |
UDP udp; | |
void setup() { | |
size(640, 480); | |
udp = new UDP(this, PORT, IP); | |
udp.listen(true); | |
udp.log(true); | |
println(udp.address()); | |
println(udp.isMulticast()); | |
} | |
void draw() { | |
// println("draw"); | |
background(0); | |
} | |
void receive(byte[] data) { | |
println("data:" + data.length); | |
/* | |
String string = new String(data); | |
int[] hoge = parseInt(data); | |
try { | |
// println(string); | |
println(hoge.length); | |
print("begin"); | |
println(hoge.length); | |
println(data.length); | |
// println(data); | |
println(hoge); | |
println(string); | |
println("end"); | |
} | |
catch (Exception e) { | |
e.printStackTrace(); | |
} | |
*/ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment