Echo server: Difference between revisions

(→‎{{header|C}}: Restructured code to be less obscure and less nested)
(→‎{{header|Tcl}}: A few notes)
Line 805:
 
=={{header|Tcl}}==
This code is single-threaded. It uses non-blocking I/O to perform the transfers, sitting on top of the event multiplexer system call (e.g., <code>select()</code> on Unix) to decide when to take new connections or service a particular socket. This makes this into a very lightweight echo server in terms of overall system resources.
 
<lang tcl># How to handle an incoming new connection
proc acceptEcho {chan host port} {
Anonymous user