tags:

views:

29

answers:

1

Here's an example of opening and reading data from a TCP socket. Is there a way to create a UDP socket as well?

void setup() {
    c = new Client(this, "127.0.0.1", 12345); // Replace with your server's IP and port
}

void draw() {
    if (c.available() > 0) {
        input = c.readString();

http://www.processing.org/learning/libraries/sharedcanvasclient.html

+1  A: 

You can use the UDP library for processing (http://ubaa.net/shared/processing/udp/). Some examples are provided, so you can start experimenting with UDP easily.

I have used UDP communication in processing a lot for many projects. The implementation is really good and ready for real world applications.

razong