title: How the reading from and writing to sockets are synchronized?
body: <p>We create a socket. On one side of the socket we have a "server" and on another side there is a "client". Both, the server and client, can write to and read from the socket. It is what i understand. I do not understand the following things:</p>
  
  <ol>
  <li><p>If a server reads from the socket, does it see in the socket only those stuff which was written to the socket by the client? I mean if server writes something to the socket and than reads from the socket, will it (server) see in the socket the stuff it (server) wrote there? I hope not.</p></li>
  <li><p>Let's consider the following situation. A client write something to the socket and then it writes something new to the socket and then server reads from the socket. What will the server  see there? Only the "new" stuff written by the client or both "new" and "old" one?</p></li>
  <li><p>If a client (or server) writes to the socket, can it see if the written information was received by other side? For example <code>out.println("Hello, Server!")</code> will return <code>true</code> it server received this message.</p></li>
  </ol>