Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!spool.mu.edu!agate!darkstar!taiyang!hollosi From: hollosi@taiyang.ucsc.edu ( Joseph Hollosi ) Newsgroups: comp.unix.programmer Subject: sockets: char-mode & getpeername ? Message-ID: <17602@darkstar.ucsc.edu> Date: 30 Jun 91 08:16:49 GMT Article-I.D.: darkstar.17602 Sender: usenet@darkstar.ucsc.edu Reply-To: Joseph Hollosi Organization: UCSC, Santa Cruz, CA Lines: 15 I am writing a server to which I want to connect by a usual "telnet hostname port" command. Everything works, except two things: 1. how can I read() input which is not terminated by ; it seems, that read() doesn't read anything (even I want to read one character only) until a line is typed in. ("man telnet" mentions a char-mode, but I want to set that from the other side)? I think this may be solved by using non-blocking read, but I would prefer the blocking version, because it gives you the chance to discover if the telnet is broken (killed) on the other side. 2. how can I get the name of machine from where the telnet is initiated; I tried getpeername(), but it gave some mess? Thanks, please reply to , Joseph.