C2dmSharp.Server.C2dmMessageTransportAsync.responseCallback C# (CSharp) Method

responseCallback() static private method

static private responseCallback ( IAsyncResult result ) : void
result IAsyncResult
return void
        static void responseCallback(IAsyncResult result)
        {
            var msg = new C2dmMessage();

            try
            {
                var asyncParam = result.AsyncState as C2dmAsyncParameters;
                msg = asyncParam.Message;

                try
                {
                    asyncParam.WebResponse = asyncParam.WebRequest.EndGetResponse(result) as HttpWebResponse;
                    processResponseOk(asyncParam);
                }
                catch (WebException wex)
                {
                    asyncParam.WebResponse = wex.Response as HttpWebResponse;
                    processResponseError(asyncParam);
                }
            }
            catch (Exception ex)
            {
                if (UnhandledException != null)
                    UnhandledException(msg, ex);
                else
                    throw ex;
            }
        }