title: Socket does not throw exception when trying to write to closed connection
body: <p>i am new in java socket programming but i have faced the problem.<br>
  When i trying to write to connection that is unexpectedly closed in client side i don`t get any exception.
  I have Server side.</p>
  
  <pre><code>    public static void main(String[] args) throws IOException { 
      ServerSocket socket = new ServerSocket(8036);
      String st;
      while(true) {
          System.out.println("hello");
          Socket socket1 = socket.accept();
          BufferedReader reader = new BufferedReader(new InputStreamReader (socket1.getInputStream()));
          BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(socket1.getOutputStream()));
          System.out.println(reader.readLine());
          writer.write("h");
          writer.flush();
      }
  }
  </code></pre>
  
  <p>And Client</p>
  
  <pre><code>    public static void main(String[] args) throws  Exception{
  
      Inet4Address s = (Inet4Address)Inet4Address.getByName("localhost");
      System.out.println("begin");
       Socket socket = new Socket(s,8036);
       BufferedWriter w = new BufferedWriter (new OutputStreamWriter(socket.getOutputStream()));
       BufferedReader reader = new BufferedReader(new InputStreamReader(socket.getInputStream()));
       String h ;
       int prev = 0;
  }
  </code></pre>
  
  <p>As you can see client exits immediately after connection, I even don't close socket, just try to model client that have exited unexpectedly. However I don't get exception in server side while trying write to socket. Why? </p>