处理:打开UDP套接字进行读取?
下面是打开 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
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用UDP库进行处理(http://ubaa.net/shared/processing/udp/ )。提供了一些示例,因此您可以轻松开始尝试 UDP。
我在很多项目中使用了UDP通信进行处理。该实现非常好,可以用于现实世界的应用。
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.