this forum is not for general programming support. despite you using pretty old framework classes and methods for TCP communication, make sure you are connecting to non-ssl IP:Port as you don’t have support for that in your code.
you can verify if connection is valid by sending a PING