Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Any ideas on how to speed this up?

    I've been researching this for a while and this forum keeps showing up so i thought id see if anyone here could help. So without to much explanation, i'm essentially trying to get a web page component to cause the web server its running on to issue a telnet command. I have this working already by triggering php with a button to execute a shell script that creates a new telnet session and issues the command.

    The problem is that the telnet session takes a few seconds to connect, meaning that the command is not sent till a few seconds after the button is pressed. I'd like to speed this up, one way that occurred to me would be to keep some kind of persistent telnet session going in the background and just issues commands to it when necessary but i'm not really sure how to implement that, any ideas?

  2. #2
    You can try starting your telnet session in a screen terminal and throw it in the background. You can then stuff commands into the screen later (via your CGI script or whatever).

    I've done this before with screen running a Bash terminal, but never a telnet session. Worth a try, though.

    See this discussion for some tips on how to proceed with screen and stuffing:

    bash - Send commands to a GNU screen - Stack Overflow

  3. #3
    That's just what i was looking for! I had seen Screen referenced in a few places but i wasn't to sure how to use it, that post really cleared it up. I'm actually switching to using http instead of telnet (don't ask how that makes sense, the endpoint is an arduino so i dictate how it handles incoming connections) but you answered my original question so ill mark this as solved.

  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts