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

send() static private method

static private send ( C2dmMessage msg, string googleLoginAuthorizationToken, string senderID, string applicationID ) : void
msg C2dmMessage
googleLoginAuthorizationToken string
senderID string
applicationID string
return void
        static void send(C2dmMessage msg, string googleLoginAuthorizationToken, string senderID, string applicationID)
        {
            C2dmMessageTransportResponse result = new C2dmMessageTransportResponse();
            result.Message = msg;

            var postData = msg.GetPostData();

            var webReq = (HttpWebRequest)WebRequest.Create(C2DM_SEND_URL);
            //webReq.ContentLength = postData.Length;
            webReq.Method = "POST";
            webReq.ContentType = "application/x-www-form-urlencoded";
            webReq.UserAgent = "C2DM-Sharp (version: 1.0)";
            webReq.Headers.Add("Authorization: GoogleLogin auth=" + googleLoginAuthorizationToken);

            webReq.BeginGetRequestStream(new AsyncCallback(requestStreamCallback), new C2dmAsyncParameters()
            {
                WebRequest = webReq,
                WebResponse = null,
                Message = msg,
                GoogleAuthToken = googleLoginAuthorizationToken,
                SenderId = senderID,
                ApplicationId = applicationID
            });
        }