Here is a simple implementation of TCPServer where all i wanted to do is send a string to client when requested.

```
import java.util.*;
import java.io.*;
import java.net.*;
class TCPServer{
    public static void main(String args[]) throws Exception{
    ServerSocket server = new ServerSocket(4888);
    while(true){
        Socket client = server.accept();
        DataOutputStream out = new DataOutputStream(client.getOutputStream());
        String send = "Bhushan Patil \n 11-237 \n CMPN";
        out.writeBytes(send);
        }
    }
}

```

But on clinet side only Bhushan Patil is shown not the rest of the string. 

Here is the code of client.

```
import java.util.*;
import java.io.*;
import java.net.*;
class TCPClient{
    public static void main(String args[]) throws Exception{
    Socket client = new Socket("localhost",4888);
    BufferedReader in = new BufferedReader(new InputStreamReader(client.getInputStream    ()));
    String display = in.readLine();
    System.out.println(display);
}
}

```

Can anyone explain why it is happening?
When i do 

```
System.out.println(send);

```

I get the whole string with \n so i am assuming that you dont get new lines. Correct me if i am wrong. Thanx