title: how to tell server that client already finished the output without shutting down the outputstream
body: <p>I having the following code to create a client socket to send/receive data:</p>
  
  <pre><code>val socket:Socket = new Socket(InetAddress.getByName("127.0.0.1"), 7777)
  val inputStream = socket.getInputStream()
  val bufferSource = new BufferedSource(inputStream)
  val out = new PrintStream(socket.getOutputStream())
  
  var data = "Hello Everyone"
  out.println(data)
  out.flush()
  ***socket.shutdownOutput()***
  val in = bufferSource.getLines()
  if (in.hasNext) {
    println(in.next())
  }
  </code></pre>
  
  <p>If I don't run <strong>socket.shutdownOutput()</strong>, I won't get the data from server,
  because Server side is still waiting the input. Therefore I have to shutdown the outputStream.
  But if shutdown the output, it can not be reopen. So I have to create a new socket for sending new data.
  That caused sending one record needs to create a new socket. This is really awkward.
  Is there any other way to tell the server that the output already finished without shutting down the output please.
  Thanks in advance!</p>