Echo server: Difference between revisions
Content added Content deleted
(→{{header|C}}: Restructured code to be less obscure and less nested) |
(→{{header|Tcl}}: A few notes) |
||
Line 805: | Line 805: | ||
=={{header|Tcl}}== |
=={{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 |
<lang tcl># How to handle an incoming new connection |
||
proc acceptEcho {chan host port} { |
proc acceptEcho {chan host port} { |