title: Measuring network traffic with Indy
body: <p>I'm using a TIdTCPCmdServer to handle all communication with client applications. I would like my server to log all kind of stuff including network traffic. Is there any easy or clever way to see how much bytes the TCPCmdServer actually received and sent? I can only think of code like</p>
  
  <pre><code>ASender.SendReply;
  Inc (FTraffic, Sizeof (ASender.NormalReply.Code) +
                 Sizeof (Char) * ASender.NormalReply.Text.Length));
  </code></pre>
  
  <p>which is extremely ugly in my opinion because these traffic updates would be spreaded out all over my code and are fairly complicated as well.</p>
  
  <p>Any suggestions?</p>
  
  <p>Thanks for your help.</p>