Socket Connection Telnet

Hi Guys, good morning…

I’m trying to create a connection in an IP and Port. A simple connection using socket.
But, I’ve failed.
I need to close a connection with an another hardware using Telnet.
Does someone have any idea how I can accomplish this?

I’m using creator for my application…