1

这是从 TCP 套接字打开和读取数据的示例。有没有办法创建一个 UDP 套接字?

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

4

1 回答 1

3

您可以使用 UDP 库进行处理 ( http://ubaa.net/shared/processing/udp/ )。提供了一些示例,因此您可以轻松地开始试验 UDP。

我在许多项目的处理过程中使用了 UDP 通信。该实现非常好,可以为现实世界的应用程序做好准备。

于 2010-07-15T21:59:05.743 回答