When describing the code for
getdate they say
If this call fails, set the status boolean value to false. Otherwise, create a new string called dateresult and concatenate it into a sentence.
However this is not what the code does. There is not an else clause that create a new string if there is not an error. It is going to do that even if there is an error.
Further, the standard port for Control Center on MacOS is 5000. I would suggest changing the port used in the code to something different.