Here is the code for a chat client which I made a few days back to get to know a little about sockets and threads. Please run the server file first and then the client. Change the server name from hawk (this is my computer name) to your server name.
You can download the code for client from here:
You can download the code for sever from here
Hope u like it 🙂