Resolve UDP Port Connection Errors
Issue
If you are unable to connect to a UDP socket using the udpport
interface, follow these troubleshooting steps.
Possible Solutions
Make sure that your network adapter is enabled and connected.
Make sure that you do not specify a local port that is already in use. In addition, you can only create one
udpportobject for a given host and port combination. To see all local ports in use, run the following command in MATLAB®.!netstat -a -n -p UDPIf you are using the same port for multiple UDP sockets, make sure that port sharing is enabled for the specified port.
If you specified
LocalHostas a name-value argument, make sure that it represents your computer's host name or IP address that you want to listen on for incoming UDP packets. If you want to specify the host name or address to send packets to, specify it in thewrite(byte-type and datagram-typeudpportobjects) orwriteline(byte-typeudpportobjects) functions.If you specified a local host, check that the local host IP address is available on your machine. To see valid IP addresses for your machine, run the following command in MATLAB on Windows®.
!ipconfigOn Linux® and macOS, run the following command.
!ifconfigVerify that the specified local host name is valid by using
resolvehost.