Is there a way for a computer to test a telnet connection to a local server using C++? I've used _popen() to pipe a telnet connection line into cmd and it connected to the server, but I haven't been able to find a way for my code to receive feedback on whether or not the connection was successful or not. And because a telnet connection opens a new window, I haven't figured out how to pipe commands into the telnet window or even just exit out of it automatically. Is there a way to have the code receive any indication that the connection was successful?
I'm on Windows 10 and am using Visual Studio Community 2019 with C++ 14