MATLAB: Do I receive “FLEXlm error: -15,570. System Error: 10038 Winsock: Specified socket is invalid” when I try to start MATLAB

MATLAB

License Manager Error -15
Cannot connect to license server
The server (lmgrd) has not been started yet, or
the wrong port@host or license file is being used, or the
port or hostname in the license file has been changed.
Feature: MATLAB
Server Name: Server1
License path: C:\MATLAB6p5\bin\win32\license.dat;C:\MATLAB6p5\bin\win32\*.lic
FLEXlm error: -15,570. System Error: 10038 "Winsock: Specified socket is invalid"
A variation on this error is: ERROR: License Manager Error -15 Cannot connect to license server The server (lmgrd) has not been started yet, or the wrong port@host or license file is being used, or the port or hostname in the license file has been changed. Feature: MATLAB Server Name: Server1 License path: C:\MATLAB6p5\bin\win32\license.dat;C:\MATLAB6p5\bin\win32\*.lic FLEXlm error: -15,570. System Error: 10061 "Winsock: Specified socket is invalid"

Best Answer

If the following error is displayed:
FLEXlm error: -15,570. System Error: 10038 "Winsock: Specified socket is invalid"
or
FLEXlm error: -15,570. System Error: 10038 "Winsock: Connection refused"
To resolve this issue, please try the following workarounds:
- Ensure that the same port numbers are listing in the SERVER line of the license.dat file on both the license server and client.
- Disable security software (e.g. antivirus)
- Uninstall wireless networking software
- Uninstall software/drivers for on-board infrared devices
- Reinstall the TCP/IP network stack
- If the network license manager is on Windows Vista, move the license manager files from the "C:\Program Files" folder to another folder (e.g. C:\flexlm).
If the error includes this line: ERROR: FLEXlm error: -15,570. System Error: 10061 "Winsock: Specified socket is invalid"
There is a port number conflict.
The network license manager operates using two TCP ports.
In order to use a firewall with FLEXnet, you will need to configure your license to use static ports and then open these in any network security that you have.
To do so, follow the steps below:
The first port the license manager uses is specified as the last argument of the SERVER line in the license file. This port is used for the initial connection to the license server. For example, this line below:
SERVER license-server-1 0011aabbcc22 27000
shows that the license manager is using port 27000. If you do not have a port number on the end of this line, you will need to specify a port. By default MathWorks uses port 27000 upon installation, however you can specify any open port on the machine.
To verify which ports are in use on your system, you can use the "netstat" utility. This utility is called from the DOS prompt for Windows, or through a terminal window on Linux/Unix/Mac. To use the utility, execute the following command:
netstat -a -p tcp
The other license manager port is specified in DAEMON line of the license file. By default, the vendor DAEMON (MLM) uses a random open port. In order for the license manager to work with network security software and firewalls, you must specify an open port on your system for MLM. This specification is done in the license file by adding the flag 'port=' to the end of the DAEMON line. For example:
DAEMON MLM "C:\flexlm\mlm.exe" port=1711
In this example, MLM is tied to port 1711. Again, this must be a free port on the machine. If a port number which is already in use is chosen, a "port in use" error message will be generated when the license manager is restarted.
If you changed the ports, you will need to restart the license manager for the changes to take effect. Once the license manager is started successfully with the changes, you will need to open the ports any firewalls. Once open, you should be able to check out a license through a firewall.
NOTE: If client machines have a firewall, you will need to open the two ports on the client firewall as well.