Threaded Socket

package threadclient;

import java.net.*;
import java.io.*;
class ThreadedClient extends Thread
{
private BufferedReader in;
private PrintWriter out;
int count;
String msg;
// store count and message
public ThreadedClient (int count, String msg )
{
this.count = count;
this.msg = msg;
}
public static void main(String args[])
{
// make many clients each with an id number
ThreadedClient client1 = new ThreadedClient(1,"one");
ThreadedClient client2 = new ThreadedClient(2,"two");
ThreadedClient client3 = new ThreadedClient(3,"three");
ThreadedClient client4 = new ThreadedClient(4,"four");
// start each thread
client1.start();
client2.start();
client3.start();
client4.start();
}
public void run( ){
// send number of messages
for(int i=0;i<count;i++) {
try
{
send("localhost",2000,msg);
sleep(100);
}
catch(InterruptedException e){}
}
}
// send message to server
public void send(String server, int port, String msg)
{
try
{
// get socket connection
Socket s = new Socket(server, port);
// get input/output streams
out = new PrintWriter(s.getOutputStream());
in = new BufferedReader(new
InputStreamReader(s.getInputStream()));
// send message
out.println(msg);
out.flush();
System.out.println("client sending: " + msg);
// get data from server
String line;
if ((line = in.readLine()) != null)
System.out.println("client received:" + line);
}
catch (IOException e){System.out.println("connection error:" + e);}
}
}



package threadedserver;

import java.io.*;
import java.net.*;
class ThreadedHandler extends Thread
{
private Socket socket;
private int ident;
public ThreadedHandler(Socket s, int id) { socket = s; ident = id; }
// service clients
public void run()
{
try
{
// get input output streams
BufferedReader in = new BufferedReader
(new InputStreamReader(socket.getInputStream()));
PrintWriter out = new PrintWriter
(socket.getOutputStream(), true /* autoFlush */);
// continuously receive and send back messages
while (true)
{
String str = in.readLine();
if (str == null) break;
System.out.println
("server received (" + ident + ") " + str);
out.println(str);
}
socket.close(); // no more messages close connection
}
catch (Exception e) {System.out.println(e);}
}

}
package threadedserver;

import java.io.*;
import java.net.*;
public class ThreadedServer
{
public static void main(String[] args )
{
int counter = 0;
try
{
// listen on port for clients
ServerSocket s = new ServerSocket(2000);
while(true)
{
// wait for clients
Socket incoming = s.accept( );
// client sent a message
System.out.println("server received (" + counter + ")");
// create thread to service client at socket connection
new ThreadedHandler(incoming, counter).start();
counter++;
}
}
catch (Exception e){ System.out.println(e);}
} // end main
}

Output

client sending: four
client sending: one
client sending: three
client sending: two
client received:four
client received: one
client received:two
client received:three
client sending: three
client sending: two
client sending: four
client received:two
client received:four
client received:three
client sending: three
client sending: four
client received:three
client received:four
client sending: four
client received:four

Every time I run this code, I see 20 lines in output, Why?

4 + 3 + 2 + 1 = 10

10 x 2 (for both sending and receiving messages) = 20

Am I missing something more then that?