When a client first connects it needs to send some identifying data to the server.
For example it could send a String that the server can read to know what client is connected with that socket. The client could use one of the methods of the DataOutputStream class to write a String. For example: writeUTF(). The server would use the readUtF() method to read the String.