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