title: Indy - ReadLnSplit Causes NotConnected Exception when closing
body: <p>I use TIdTCPServer and the following code to read client input :</p>
  
  <pre><code>repeat
      cl3:=cl3+AContext.Connection.IOHandler.ReadLnSplit(WasSplit,#0,-1,-1,TEncoding.UTF8);
      until not WasSplit;
  </code></pre>
  
  <p>However if client is connected to the server and I close the server it raises an exception class (EIdNotConnected) whith message 'Not connected'.<br>
  If I use <em>ReadLn</em> instead <em>ReadLnSplit</em> no exception raises.</p>
  
  <p>What causes this exception and how could I prevent it?</p>
  
  <p>I suppose the solution is simple but I am new to sockets and Indy and I cant figure it out.</p>
  
  <p>Thanks in advance.</p>