Main Content

Resolve TCP/IP Server Connection Errors


If you are unable to create a TCP/IP server using the tcpserver interface, follow these troubleshooting steps.

Possible Solutions

  • Make sure that your network adapter is enabled and connected.

  • Check that the IP address you specify is available on your machine. To see valid IP addresses for your machine, run the following command in MATLAB® on Windows®.


    On Linux® and macOS, run the following command.


  • Verify that the specified IP address or host name is valid by using resolvehost. If the output is empty, the specified IP address or host name is invalid. For example, if the host name is, run the following.

    [name,address] = resolvehost("")
    name =
    address =
  • Make sure that you do not specify a port that is already in use. In addition, you can only create one server object for a given address and port combination. To see all TCP/IP ports in use, run the following command in MATLAB.

    !netstat -a -n -p TCP

See Also

Related Topics