(Message outgoing:637) Subject: Re: ANNOUNCE: Tcl 7.5b1 and Tk4.1b1 releases From: John Robert LoVerso Date: Tue, 06 Feb 96 14:50:50 -0500 To: Jabob.Levy@eng.sun.com (Jacob Levy), Brent Welch , John.Ousterhout@eng.sun.com X-Face: "UZ!}1W2N?eJdN(`1%|/OOPqJ).Idk?UyvWw'W-%`Gto8^IkEm>.g1O$[.;~}8E=Ire0|lO .o>:NlJS1@vO9bVmswRoq3j DdX9YGSeJ5a(mfX[1u>Z63G5_^+'8LVqjqvn X-Url: http://www.osf.org/~loverso/ You can imagine my surprise when the man page for fconfigure hinted that -translate can handle NUL characters: -translation mode In Tcl scripts the end of a line is always represented using a single newline character (\0. it turns out to be an error in the roff source: single newline character (\e\n). ^ extra slash > John forgot to mention that the socket command was initially prototyped by > Brent Welch (brent.welch@eng.sun.com) and Brent also made some performance Here is my list of problems with the socket command, in contrast to how it works in TclX7.4: -- It always binds server sockets to a localhost name. This certainly breaks on multi-homed hosts, as well as preventing me from testing the service via a connection to "localhost". -- I can't tell it to bind to a random local port when creating a server socket. -- It doesn't provide an interface for allocating a "reserved local port" (I submitted code to Neosoft to implement this; it was added to one of the patchlevels of TclX7.4) -- It doesn't provide the ability to get the port number of a connected peer ala TclX "fstat $fid remotehost". One advantage: the new connection command upcall doesn't force a reverse DNS lookup (like the remotehost option does) -- Similarly, it doesn't provide a similar mechanism to "fstat $fid localhost". While this isn't truly necessary for sockets created inside of Tcl, it means I can't tell anything about inherited file descriptors. In the past, I've been able to run TclX scripts from inetd and find out who is talking to me via these fstat options. It is unclear if/how the new file I/O mechanism will handle this (i.e., if stdin is really a socket!) -- "info hostname" is somewhat alien to the "info" command, which otherwise only returns information about the Tcl interpreter. -- No hook to gethostbyname() and gethostbyaddr() ala TclX "server_info" (which I think is a horrible way to do this, but...) tcl>server_info official_name 127.1 localhost tcl>server_info official_name localhost localhost.osf.org Finally, as for fconfigure: -- Perhaps provide an "fconfigure -translation none", so as to be somewhat compatible with previous semantics and/or provide a "fast path" that avoids scanning the data during the "read" command (but not "gets"). John (Message outgoing:637)