home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / protocol / tcpip / 4085 < prev    next >
Encoding:
Internet Message Format  |  1992-08-12  |  2.2 KB

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