Perl Socket problem

Dan Bernstein brnstnd at kramden.acf.nyu.edu
Mon Jun 3 00:50:48 AEST 1991


In article <1991May31.095020.15271 at colorado.edu> frechett at spot.Colorado.EDU (-=Runaway Daemon=-) writes:
  [ random network code ]
> This is what opens the socket and gets it running.. Everthing happens 
> inside this while loop.  Now this is the problem.  If someone connected to the
> server from outside presses control-C it locks up the connection.

By ``connected'' you mean a telnet connection. The problem is that
TELNET is a two-way communications protocol, and when the telnet client
says ``Hey, I received a ^C, and I know that's an interrupt, so what are
you going to do about it?'' it expects an answer before it produces
further output. If you want your server to talk correctly to telnet,
you'd better support the TELNET protocol.

(You might ask at this point why every dumb little network application
has to support TELNET. The answer is that vendors don't realize the
virtue of a pure communications program---something that sets up a
connection but doesn't burden you with one protocol or another. So users
are going to use the telnet program even when the TELNET protocol is
entirely inappropriate. You might also ask why the standard TELNET
protocol daemon, namely telnetd, is so overloaded with network and pty
support. The answer, again, is that vendors don't realize the virtue of
a pure TELNET daemon---something that interprets the protocol but
doesn't assume that your application is a TCP login. So people like you
can't easily put together perfectly legitimate network applications.
Don't you feel lucky that the vendors are so smart?)

---Dan



More information about the Comp.unix.questions mailing list