Communicating over telnet
I can't use Boost ASIO (reasons not related to programming) and I l开发者_JAVA百科ooked around and libcurl looks good. I'm building the binaries at the moment and decided to get some feedback from the community.
Any comments regarding libcurl/alternatives?
UPDATE:
libcurl's not great for telnet. It's 2010! Shouldn't there be a simple way to do this? Winsock?
Telnet is a very simple protocol. Some wonky stuff to negotiate the terminal type but I'm sure your robot doesn't care where the cursor ends up. Just use a socket to open a TCP/IP connection on port 23 and send the command strings, terminated with a '\n'.
RFC854 is referring to it as a protocol, so perhaps it is one.
When I think of telnet I think of connecting to port 23 on a VT100 to get a terminal window to a remote UNIX host. You can also use telnet to other ports to get a TCP/IP connection which we used to use years ago on MUD/Talker servers, but this is simply a regular TCP/IP connection that is used in a connection-based client-server application. Actually "connectionless" is a misnomer as you do connect to the remote server, just in the connectionless model you do not retain the connection throughout the session, whereas in a connection-based model, the session begins when the client connects and ends when it disconnects.
精彩评论