title: Delphi - SSL TCP communication with Indy components
body: <p>I'm using the TIdSSLIOHandlerSocketOpenSSL Indy component in Delphi XE2 to send data to an SSL server (Apple Push Notification Service) over TCP.  I've got it working to a degree but not sure if I'm going about it the best way.  I'm doing the following :</p>
  
  <ul>
  <li>Set the SSL properties inc. path to certificates</li>
  <li>Call the .Open method to open the connection </li>
  <li>Check the AType parameter in the OnStatusInfoEx event until I get a 'Handshake Done'</li>
  <li>Send the data using .WriteDirect</li>
  <li>Close the connection with .Close</li>
  </ul>
  
  <p>Is there a better way to know when the connection is ready to send data?  Does anybody have sample code using the TIdSSLIOHandlerSocketOpenSSL component directly over TCP?  The samples I've found are mainly for HTTP calls where the TIdSSLIOHandlerSocketOpenSSL component is just attached to secure the connection.</p>