Web Images Videos Maps News Shopping Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
using interact with TCP socket
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Phil Freed  
View profile  
 More options May 26 2005, 3:08 pm
Newsgroups: comp.lang.tcl
From: "Phil Freed" <clt...@freed.com>
Date: Thu, 26 May 2005 19:08:43 GMT
Local: Thurs, May 26 2005 3:08 pm
Subject: using interact with TCP socket
Platform:  WinXP, cygwin

I have wrote a simple converter in Expect that is designed to take in a
telnet connection and pass it through to an SSH connection.

basically, the code is simple:

socket -server Server -myaddr 127.0.0.1 5555
vwait forever

And the Server routine (simplified to remove error checks and the like) is:

proc Server {channel clientAddr clientPort} {
  spawn -open $channel
  set telnet $spawn_id

  spawn  "/usr/bin/ssh" u...@domain.com
  interact -u $telnet

}

This works fine, except that anything typed into my telnet session appears
on the screen twice.  I've tried everything I can think of -- changing the
spawns to noecho, nottyinit & nottycopy, etc.  Is this an artifact of
opening a TCP connection with "spawn -open"?  Is there something simple that
I'm missing?  Is it simply the platform that I'm on?

Thanks for any light you may be able to shed on this.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Don Libes  
View profile  
 More options May 31 2005, 5:02 pm
Newsgroups: comp.lang.tcl
From: Don Libes <li...@nist.gov>
Date: 31 May 2005 17:02:55 -0400
Local: Tues, May 31 2005 5:02 pm
Subject: Re: using interact with TCP socket

If I understand your scenario (very cute by the way!), the extra echo
is being generated by your telnet client itself.  You didn't show you
are using a telnet client in the scenario but I assume that's what
you're using, yes?  The telnet client has a property of echoing by
default if used to any non-telnetd port.

Off the top of my head, I forget the option to turn off echoing, but
you can find it in any telnet documentation.  However, telnet also
uses a very crude line mode (which is why echoing is kinda important).
Depending on your requirements, you might want to deal with that too.

Don


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael A. Cleverly  
View profile  
 More options Jun 8 2005, 1:25 am
Newsgroups: comp.lang.tcl
From: "Michael A. Cleverly" <mich...@cleverly.com>
Date: Tue, 7 Jun 2005 23:25:15 -0600
Local: Wed, Jun 8 2005 1:25 am
Subject: Re: using interact with TCP socket

On Tue, 31 May 2005, Don Libes wrote:
> "Phil Freed" <clt...@freed.com> writes:
>> This works fine, except that anything typed into my telnet session appears
>> on the screen twice.  I've tried everything I can think of -- changing the
>> spawns to noecho, nottyinit & nottycopy, etc.  Is this an artifact of
>> opening a TCP connection with "spawn -open"?  Is there something simple that
>> I'm missing?  Is it simply the platform that I'm on?
> Off the top of my head, I forget the option to turn off echoing, but
> you can find it in any telnet documentation.  However, telnet also
> uses a very crude line mode (which is why echoing is kinda important).
> Depending on your requirements, you might want to deal with that too.

The OP could try doing a:

     puts [format %c%c%c 255 251 1]

to output the escape code to tell (a proper) telnet client to turn off
echo.  For reference, you could (request to) turn it back on with:

     puts [format %c%c%c 255 252 1]

Michael


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google