title: Messages using gen_tcp:send doesn't get sent until the socket is closed
body: <p>I want to write a simple client that sends a message to a server and receives a response. I've got a server that broadcasts the same message to all connected clients and its working when I'm testing it with telnet. When I try doing it using the Erlang shell, gen_tcp:send wont send any messages until I've close the socket.</p>
  
  <p>This is what I'm trying to do:</p>
  
  <pre><code>{ok, S} = gen_tcp:connect(IP, Port, []).
  gen_tcp:send(S, "Test").
  flush().
  </code></pre>
  
  <p>I can see that the message gets sent when I close the socket by looking at my telnet client.</p>
  
  <blockquote>
    <p>Erlang version:R14B01 (erts-5.8.2) </p>
  </blockquote>
  
  <p><strong>Update</strong></p>
  
  <p>hdima commented and said that it might be wrong with how the server extract the messages from the stream. This seems to be the case cause when I tried writing my own server the client seems to work as expected. I'll try to get the source code of the server. The server is written in Java btw. </p>