private static void SendStartTlsCallback(IAsyncResult result) { if (!result.CompletedSynchronously) { ConnectAndHandshakeAsyncResult thisPtr = (ConnectAndHandshakeAsyncResult)result.AsyncState; try { StartTlsCommand.EndSend(result); thisPtr.TlsStreamAuthenticate(); } catch (Exception e) { thisPtr.InvokeCallback(e); } } }