home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dtix!darwin.sura.net!haven.umd.edu!mimsy!lhc!mcmathmac.nlm.nih.gov!user
- From: mcmath@csb1.nlm.nih.gov (Chuck McMath)
- Newsgroups: comp.protocols.tcp-ip
- Subject: Help! with Telnet Connection Programming
- Message-ID: <mcmath-120892151132@mcmathmac.nlm.nih.gov>
- Date: 12 Aug 92 19:19:38 GMT
- Sender: usenet@nlm.nih.gov (usenet news poster)
- Followup-To: comp.protocols.tcp-ip
- Organization: MSD
- Lines: 45
-
- Help me puhleeze!
-
- I am programming a simple Telnet connection in an existing program. I have
- read the RFC and (kinda) understand it. My connection is pretty much
- batch-oriented; that is, the user specifies a bunch of stuff at the
- beginning, then starts up the connection, which transfers a bunch of data
- back and forth, and then disconnects. Currently this is done using a modem
- only, and I am adding tcp/ip access.
-
- Ok, now for the question. I have a simple little program that does
- synchronous reads and writes on the Telnet port. It looks for and handles
- all of the option sequences (mostly by telling the other end it WONT do
- whatever it asks). This program works fine when I connect to a local Sun
- machine. But when I try to connect to the target machine, it hangs. Here
- is what happens:
-
- 1. target machine sends IAC DO TERMINAL-TYPE
- 2. my program sends IAC WILL TERMINAL-TYPE
-
- and here I do a read, and it just sits there until it times out.
-
- I have tried doing 2 reads in succession, but there is only that 3 byte
- sequence on the line.
-
- I have spied on this machine using another telnet program, and in the other
- program here is what happens:
-
- 1. target machine sends IAC DO TERMINAL-TYPE
- 2. this program answers IAC WILL TERMINAL-TYPE
- 3. target machine sends IAC SB TERMINAL-TYPE SEND IAC SE
-
- and they go on their merry way.
-
-
- Anybody want to take a stab at what's wrong? Do I need to do asynchronous
- reads? That's all I can figure. Or am I supremely stupid somewhere?
- Thanks for any help.
-
- chuck
-
-
- |- chuck mcmath - mcmath@csb1.nlm.nih.gov - MSD, Inc. ------------|
- |- National Library of Medicine - National Institutes of Health --|
- |- Bethesda, MD 20894 - !aixelsyd evah uoy siht daer nac uoy fI -|
- |- "Hey batter, hey batter, hey batter, swing" - Anon. -----------|
-