yash101
yash101

Reputation: 671

Telnet server within C++ app

I am writing an application to run on a robot. Currently, it is headless, but I want to be able to telnet directly to the application with no authentication and access a shell that I will write.

Is this possible? Would it be practical or are there much easier solutions?

Upvotes: 2

Views: 2063

Answers (2)

b2Wc0EKKOvLPn
b2Wc0EKKOvLPn

Reputation: 2074

If you're using a custom shell, why would you need telnet? Your shell can have a daemon component to listen on given port and then hand over the interaction to whatever REPL your shell would implement.

Upvotes: 0

Mats Petersson
Mats Petersson

Reputation: 129314

It is entirely possible.

However, if you are using Linux, you may just as well just let your application do it's I/O to the terminal, and use telnet to log in. If you set up a user to use your application as the "login-shell", it will allow direct access to that user called "robot" (for example) (and you can set it to have no password too) - then just do telnet -l robot machine port.

This would save you the effort of writing your own telnet client, and give you almost identical functionality.

Upvotes: 4

Related Questions