simple tcp server chat using bsd-sockets and select