UDP 接口
用户数据报协议 (UDP) 是位于互联网协议 (IP) 顶层的传输协议。使用 UDP 接口读取和写入二进制数据和 ASCII 数据。您可以向服务器、计算机和仪器读取和写入数据,并使用流视频和音频、销售点系统和其他业务应用程序。
函数
App
UDP 通信管理器 | Create UDP socket and communicate over networks using UDP (自 R2022a 起) |
模块
UDP Receive | Receive data over UDP network from specified remote machine |
UDP Send | Send data over UDP network to specified remote machine |
主题
- Create a UDP Object and View Properties
Create a UDP object to establish a connection between MATLAB® and the remote host.
- UDP Communication Between Two Hosts
These are the minimum steps required to communicate between two hosts over UDP.
- Write and Read ASCII Data over UDP
Explore ASCII write and read operations with a UDP object.
- Write and Read Binary Data over UDP
Explore binary write and read operations with a UDP object.
- Use Callbacks for UDP Communication
Enhance UDP communication by executing a callback function when a specified event occurs.
- TCP/IP and UDP Comparison
Compare the TCP/IP and UDP protocols to determine which to use.
- Transition Your Code to udpport Interface
Connect to a UDP socket using
udpport
instead ofudp
.
疑难解答
Troubleshoot the UDP interface.
Resolve UDP Port Connection Errors
Troubleshoot connecting to a UDP socket.
Resolve UDP Port Warning: Unable to Read Any Data
Troubleshoot when you receive no data and you get the warning message: 'udpport' unable to read any data.
Resolve UDP Port Warning: Unable to Read All Data
Troubleshoot when you receive some data and you get the warning message: 'udpport' unable to read all requested data.