home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / protocol / tcpip / 3771 < prev    next >
Encoding:
Text File  |  1992-07-21  |  2.2 KB  |  53 lines

  1. Newsgroups: comp.protocols.tcp-ip
  2. Path: sparky!uunet!sun-barr!sh.wide!wnoc-tyo-news!ccut!s.u-tokyo!is.s.u-tokyo!jeff
  3. From: jeff@is.s.u-tokyo.ac.jp (Jeff McAffer)
  4. Subject: Help?
  5. Message-ID: <1992Jul21.112712.12158@kei.is.s.u-tokyo.ac.jp>
  6. Sender: news@kei.is.s.u-tokyo.ac.jp (Usenet News System)
  7. Nntp-Posting-Host: ingrid
  8. Reply-To: jeff@is.s.u-tokyo.ac.jp
  9. Organization: Dept. of Infomation Science, University of Tokyo.
  10. Distribution: comp
  11. Date: Tue, 21 Jul 1992 11:27:12 GMT
  12. Lines: 39
  13.  
  14.  
  15. I am trying to write what amounts to a really simple telnet (in C) and
  16. cannot seem to get it working.  I have some old rlogin code I found
  17. and some code in another language that does exactly what I want.
  18. Unfortunately I have to do it in C.  I know it is really easy and that
  19. is why I am frustrated.
  20.  
  21. Here's what I have: Following the Sun doc (net programming guide page
  22. 265) 
  23.  
  24. - get a socket, 
  25. {- bind the socket using INADDR_ANY and port 0}
  26. - setup an address structure with port 23 and the host's info from
  27.     gethostbyname.
  28. - call connect using the above mentioned address structure.
  29.  
  30. So far so good.  Note that as per the example I did not bind since
  31. that will be done for me by the local machine?  I put the {} there
  32. because I tried this with that step in and it made no difference.
  33.  
  34. So now that I have a connection?  (it didn't complain), I fork a
  35. reader and writer task.  The writer repsonds to my key presses and
  36. claims to have written successfully.  The reader ALWAYS immediately
  37. reports 3 characters whose values when printed at integers are -1, -3
  38. and 24.  That is all I ever hear from the reader.  I would have
  39. expected that the getty on the receiving end would say something.  Are
  40. these chars some sort of handshake that I have to respond to?  What is
  41. the response?
  42.  
  43. All I want to do is pass, *completely* unprocessed characters from
  44. standard in to the socket stream and from the socket stream to stdout.
  45. I would really appreciate any help or code :-) you can give me.
  46.  
  47. Thanks for reading this.
  48.  
  49. --
  50. ja mata, |m       -- Silence and stillness were everywhere except his head.
  51.                      Sweat dripped and "I'd rather be drinking a beer",
  52.                      roared as he contemplated the remaining threads.      #2
  53.