Example of simple socket programming using Java