pass value to the server
<p>How do I modify this code and pass msg string value to the server? I don't want it to print any character on the console. On my server, I receive a Null value.</p>

<pre><code>import java.net.*;
import java.io.*;

public class SocketClient {
    public static void main(String[] args) {
    // Create a socket without a timeout

String msg = "sssssssssssssssssssssss";
    try {
        InetAddress addr = InetAddress.getByName("127.0.0.1");
        int port = 8090;

        Socket socket = new Socket(addr, port);
        //ObjectOutputStream oos = new ObjectOutputStream(socket.getOutputStream());
        BufferedWriter oos = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));
        System.out.println("qqqqqqqq");
        oos.write(msg);
        oos.flush();

        oos.close();


    } catch (UnknownHostException e) {
    } catch (IOException e) {
    }
</code></pre>
