Enough praise hasn't been given to Tcl regarding its TCP networking capabilities. While UDP support is lacking in the core, you are given access to a powerful, event driven I/O facility by means of socket, fileevent, fconfigure, gets, read et al. The capabilities assumed by Network server application template (and other, better templates) are unmatched by other scripting languages.
Ah, the wonderful compression of:
fconfigure $chan -blocking 0 -buffering line; fileevent $chan readable [list handle_input $chan]
-- Todd Coram heaping praise where praise is due