Multithreaded chat server for multiple clients