Laying the foundation for socket-based TTY I/O.