How to use Socket API for creating Client-Server application in Java