Esempio n. 1
0
            private bool SendHello()
            {
                IAsyncResult result = HelloCommand.BeginSend(_connection, _connection._client.clientDomain, s_sendHelloCallback, this);

                //if ehello isn't supported, assume basic auth
                if (result.CompletedSynchronously)
                {
                    _connection._supportedAuth = SupportedAuth.Login;
                    HelloCommand.EndSend(result);
                    Authenticate();
                    return(true);
                }
                return(false);
            }
Esempio n. 2
0
 private static void SendHelloCallback(IAsyncResult result)
 {
     if (!result.CompletedSynchronously)
     {
         ConnectAndHandshakeAsyncResult thisPtr = (ConnectAndHandshakeAsyncResult)result.AsyncState;
         try
         {
             HelloCommand.EndSend(result);
             thisPtr.Authenticate();
         }
         catch (Exception e)
         {
             thisPtr.InvokeCallback(e);
         }
     }
 }