Renamed functions.
Added synchronous I/O multiplexing with select.