I cannot use UDP at my site and we are already using TCP port 4105 for another critical application which cannot be changed.
How can I reconfigure CAM to use a different TCP port?
Client Automation - All Version
CAM is always installed with UDP and port 4104 active by default. Any change to CAM must be made post-installation.
Note that CAM can use only one port at a time. Once CAM is configured to use a new port, it will be unable to communicate with other machines that are not yet configured with the same port.
With that in mind, this is obviously a very work intensive process and requires a configuration change on all machines that use CAM.
However, if you must do so, the following batch script example will accomplish this for you. This must be executed on every machine where CAM is installed and any application using CAM will have to be restarted once the change has been made.
REM Batch file start
camclose
del /q /f %cai_msq%\cam.cfg
camconfig %computername% *CONFIG udp_port=0
camconfig %computername% *CONFIG tcp_port=<desired port>
camsave config
ren %cai_msq% save.cfg cam.cfg
camclose
exit %errorlevel%
REM Batch file end
This process will delete any preexisting CAM.CFG file that may exist (none exists by default).
It will DISABLE UDP functionality in CAM, configure the new TCP port, generate a hard copy of the new configuration as 'save.cfg' and then rename it to 'cam.cfg' before restarting CAM.
By default, when CAM starts, any settings in CAM.CFG will override the default CAM settings.
Alternatively, you can replace the following with only 'camsave persist':
camsave config
ren %cai_msq% save.cfg cam.cfg
The longer process mentioned above is to aid in debugging. If something goes wrong, 'Echo %errorlevel% >>c:\camerrors.txt' lines can be added between each command to output the success/failure of each line and identify problems if any.
NOTE: If CAM does not seem to work at all on a machine after this process, it is likely that the 'CAMSAVE CONFIG' or 'CAMSAVE PERSIST' commands timed out and left an incomplete CAM.CFG file. Try deleting CAM.CFG and then manually regenerating the file with the mentioned commands.